views:

952

answers:

3

I have several reports in SharePoint that are served by SQL Server Reporting Services in SharePoint Integrated mode. Some of these reports need to be automatically generated on the last day of the month. While SSRS itself has a "last day of month" option, SharePoint doesn't have this capability in its scheduling options.

What is the best way to add this capability? I don't mind writing code, or installing something, or enabling something I don't know about.

+1  A: 

IMO, I would look into writing a Timer Job. I wrote one for a bi-weekly data import. I'm sure you could do an EOM report generation with it.

+1  A: 

Search google for SPMonthlySchedule (timer job class in the SharePoint object model).

hobbyman
Can you expand on that a bit, perhaps give an example on how to use it?
Robert S.
Maybe you can find some more answers at this URL: http://social.msdn.microsoft.com/Forums/en-US/sharepointdevelopment/thread/d196dfd0-a58f-4c9d-ae24-8f54e082ad84/
hobbyman
+1  A: 

SPMonthlySchedule can only run on a specific date. Afaik you cannot configure it to run on the last day of the month.

I would create a timer job running daily, and doing the report if today is the last day of the month. Create a SPJobDefinition with a SPDailySchedule to achieve this.

Here is a howto.

if(DateTime.Now.Month != DateTime.Now.AddDays(1).Month)
{
 //Do report
}
Øyvind Skaar
I've figured out how to write a timer job, but I can't figure out how to tell SSRS to run the report.
Robert S.
BTW, +1 for the nice HowTo link.
Robert S.