Click here to Skip to main content
15,881,852 members
Articles / Web Development / ASP.NET
Article

Custom Scheduler - SQL Server Reporting Services

Rate me:
Please Sign up or sign in to vote.
3.04/5 (15 votes)
11 Jul 20063 min read 165.7K   1K   32   97
This article provides a customized manner of creating a scheduler for the SQL Server Reports

Sample Application

Introduction

I was currently working for a company name Hermz Software which needed to create reports using SQL Server Reporting Services as it's reporting tool. As far as creation of reports is concerned, I didnt have much problems!! However, the delivery of the reports were to be done based on the following snapshots.

Output1

Output2

Output3

This snapshots can easily be obtained from the Outlook task creator. Well, not a big deal, as SSRS had it's own scheduling techniques.... But, here comes the crux!! We needed some custom implementation for the scheduler, that wasn't being provided by the SSRS scheduler.

So, then I decided to created my own Scheduler that worked on the same architecture of the SQL Server Scheduler.

Prerequisites

In order the run this custom Scheduler, we need the following prerequisites to be present on your system.

1. SQL Server Reporting Services [Reporting server]

2. VS.net [1.1 or 2.0 framework]

3. SMTP server [email client]

4. SQL Server Database [Backend]

Architecture

The Architecture of the system is as per depicted in the diagram:

 Architecture

As per the Architecture, the system[in short] consists of 5 main layers:

1. DAC layer : This is the Data Access Control Layer. It is responsible for accessing the SQL Server Database to retrieve scheduling details.

2. Email Extension layer: This layer is responsible for sending mail using an SMTP emailing server. 

3. Logging Layer: This layer is reponsible for logging error to the user[to be located at D:\ErrorLog.txt] and for Status reporting of the system [D:\hermzLog.txt].  

4. Reporting Extension: This layer is reponsible for obtaining the reports from the report server. The Report name, which is to be fed into the database will be retrieved via this extension.

5. Process Scheduler: It is the heart of the system. Responsible for the main process/thread scheduling. The manner in which the process is scheduled is depicted in the following diagram. 

 Process Scheduling

 

Instructions

From this article, you will obtain 1. SQL script file and 2. Executable file

Steps:

1. Run the SQL Script using either isqlw or the Enterprise manager[SQL Server 2000]/SQL Server Management Studio[SQL Server 2005].

2. Run the executable at the VS.net command prompt: installutil HermzScheduler.exe

 InstallUtil

3. Check for presence of Hermz Scheduler in the Services tray. Windows->Run->Services.msc

 Services

4. Create a new login for SQL server authentication.

 Database

  Add New user

5. Add in Sample data into HermzDB database at Schedule table.

The Occurrence type is 1->Daily, 2-> Weekly, 3-> Monthly.

Report Name -> /SampleProject/SampleReport

From_name, To_name, will be the names to be present in the email

Subject is the subject of the mail.

Pattern - > Null for Daily, DateTime value for Monthly/Weekly

6. Run the HermzScheduler service.

7. If you have Outlook Express installed , then the mail will get automatically populated into you mailbox. Or else, you can view the contents present at location:C:\Inetpub\mailroot\Queue

Conclusion

This tool was created entirely for Hermz Software. Thanks to this, we can create a custom SQL Server Scheduler. I hope you liked this article. Please feel free to mail me incase of any doubts.

 

License

This article has no explicit license attached to it but may contain usage terms in the article text or the download files themselves. If in doubt please contact the author via the discussion board below.

A list of licenses authors might use can be found here


Written By
India India
Soshan is a software engineer, currently working in variant projects. She does her programming in stuff like Assembler, C++, MFC and lots of web- and database stuff and now uses ASP.NET and C# extensively, too.

In her free time, she works in animation stuffs with extensive usage of Adobe Photoshop and CorelDraw. Driving racer cars is her current craze.

Whenever she gets bored, her interests goes on to networking and hacking-ethical. Has designed an ip-filter for firewall with a group of friends.

Comments and Discussions

 
GeneralRe: scheduler Pin
An'ka25-Jul-06 9:19
An'ka25-Jul-06 9:19 
GeneralRe: scheduler Pin
Soshan Fernandes7-Aug-06 18:54
Soshan Fernandes7-Aug-06 18:54 
QuestionWhat does this offer above Out of the Box functionality Pin
buckleyc7517-Jul-06 10:15
buckleyc7517-Jul-06 10:15 
AnswerRe: What does this offer above Out of the Box functionality Pin
Soshan Fernandes21-Jul-06 16:48
Soshan Fernandes21-Jul-06 16:48 
Generalfrom South Korea [modified] Pin
wan doo kong11-Jul-06 21:01
wan doo kong11-Jul-06 21:01 
GeneralSource Code Pin
babalao28-Jun-06 7:25
babalao28-Jun-06 7:25 
QuestionSource ... Pin
mendoit27-Jun-06 1:15
mendoit27-Jun-06 1:15 
GeneralSource Pin
jtedder7-Jun-06 4:15
jtedder7-Jun-06 4:15 
GeneralSource Pin
mghosh21-May-06 3:15
mghosh21-May-06 3:15 
GeneralSource Pin
mokah8-May-06 6:32
mokah8-May-06 6:32 
GeneralRe: Source Pin
Soshan Fernandes8-May-06 18:02
Soshan Fernandes8-May-06 18:02 
GeneralRe: Source Pin
mokah9-May-06 1:03
mokah9-May-06 1:03 
GeneralRe: Source Pin
mokah9-May-06 1:05
mokah9-May-06 1:05 
GeneralRe: Source Pin
Dan Avni15-May-06 21:59
Dan Avni15-May-06 21:59 
GeneralRe: Source Pin
metti16-May-06 8:05
metti16-May-06 8:05 
GeneralRe: Source Pin
mclellan1317-May-06 3:12
mclellan1317-May-06 3:12 
QuestionRe: Source Pin
RawCode00720-May-06 1:58
RawCode00720-May-06 1:58 
GeneralRe: Source Pin
Martin Strigac12-Jul-06 0:45
Martin Strigac12-Jul-06 0:45 
QuestionRe: Source Pin
praveenkjohn16-May-07 2:54
praveenkjohn16-May-07 2:54 
GeneralRe: Source Pin
tcollinsbeb18-May-06 5:51
tcollinsbeb18-May-06 5:51 
GeneralRe: Source Pin
gt_ato23-Aug-06 13:23
gt_ato23-Aug-06 13:23 
GeneralRe: Source Pin
waddies9-Nov-06 3:31
waddies9-Nov-06 3:31 
GeneralRe: Source Pin
Aslyah M16-Nov-06 3:32
Aslyah M16-Nov-06 3:32 
GeneralLinks Pin
rmlefert8-May-06 6:21
rmlefert8-May-06 6:21 
GeneralRe: Links Pin
Soshan Fernandes8-May-06 17:59
Soshan Fernandes8-May-06 17:59 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.