Robert S.
Robert S.

Reputation: 25294

How can I schedule a report in SharePoint to run on the last day of the month?

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.

Upvotes: 1

Views: 4001

Answers (4)

Curtis
Curtis

Reputation: 685

This is pretty old but I just had the same problem.

An easy way to do this is set up 3 subscriptions for the report.

Have one email out the report on the 31st of Jan, Mar, May, Jul, Aug, Oct, Dec Have one email out the report on the 30th of Apr, Jun, Sep, Nov Have one email out the report on the 28th of Feb

Note that this does not take leap years into consideration.

Upvotes: 1

Øyvind Skaar
Øyvind Skaar

Reputation: 1840

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
}

Upvotes: 1

Lance Perry
Lance Perry

Reputation: 1306

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

Upvotes: 1

theG
theG

Reputation:

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.

Upvotes: 1

Related Questions