Contributors

Monday 10 December 2012

Showing a Date Difference

So we have a new incident tracking system. That's another project to tell you about for another day. Anyway, the old system offered a small little piece of text on our homepage (SharePoint), that showed that it is x days since last incident.

They also needed their logo and a little slogan on it too, just to add to the drama.

So I created a neat little SSRS report. And to get the number of days from the data, the code is below.

=Format(Fields!Incident_Date.Value,"dd/MM/yy") & " (" & DateDiff("d",First(Fields!Incident_Date.Value, "DataSet1"),Today) & " " & "Days Ago)"

Obviously, this will then show Incident Date (x Days Ago).

In the report, I had the logo and slogan next to it.

So next was to display it on our homepage using SQL Server Reporting Web Part. I also decided to get a snapshot of the data every morning rather than people rendering the data every time they load the homepage. This worked quite well!

In order to create a snap shot, click on the drop down arrow next to the report in question in your report library and click on "Manage Processing Options" to say when the report should be rendered.

Works a treat and you can have the report and the data in completely seperate Web Applications and it still works wonders. Wow SharePoint.

No comments:

Post a Comment