Click here to Skip to main content
15,881,709 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

 
GeneralArtical is too good Pin
BYoga.reddy11-Oct-07 3:50
BYoga.reddy11-Oct-07 3:50 
QuestionCan you please send sample Source code Pin
pramodsangal273-Aug-07 0:06
pramodsangal273-Aug-07 0:06 
Questioni want to use the same thing but without reporting services Pin
siddhamalli4-Apr-07 7:56
siddhamalli4-Apr-07 7:56 
GeneralSource Code Pin
Frazer J19-Mar-07 10:35
Frazer J19-Mar-07 10:35 
GeneralSource Code Pin
abraylyan12-Mar-07 4:54
abraylyan12-Mar-07 4:54 
QuestionSource Code needed. Pin
Aslyah M22-Feb-07 2:43
Aslyah M22-Feb-07 2:43 
GeneralPlease send code Pin
eerwin19-Feb-07 18:12
eerwin19-Feb-07 18:12 
GeneralCode Pin
SimonSte9-Jan-07 3:47
SimonSte9-Jan-07 3:47 
GeneralCode for this Pin
Member 36860852-Jan-07 0:42
Member 36860852-Jan-07 0:42 
Generala problem Pin
navratankorma10-Dec-06 10:51
navratankorma10-Dec-06 10:51 
GeneralRe: a problem Pin
Soshan Fernandes6-Jan-07 5:05
Soshan Fernandes6-Jan-07 5:05 
Generalsource Pin
djoubert30-Nov-06 5:57
djoubert30-Nov-06 5:57 
GeneralRe: source Pin
sashidhar2-Nov-09 5:57
sashidhar2-Nov-09 5:57 
QuestionRegarding Login of Hermz Pin
Ravindra8323-Oct-06 2:17
Ravindra8323-Oct-06 2:17 
AnswerRe: Regarding Login of Hermz Pin
Soshan Fernandes23-Oct-06 4:49
Soshan Fernandes23-Oct-06 4:49 
GeneralRe: Regarding Login of Hermz Pin
Ravindra8325-Oct-06 18:30
Ravindra8325-Oct-06 18:30 
GeneralSource Pin
Mike Lavender17-Oct-06 13:10
Mike Lavender17-Oct-06 13:10 
GeneralSource Pin
Howard Diesel11-Sep-06 1:31
Howard Diesel11-Sep-06 1:31 
GeneralRe: Source Pin
lichongbin24-Feb-08 19:54
lichongbin24-Feb-08 19:54 
Generalscheduler Pin
logistum20-Jul-06 15:49
logistum20-Jul-06 15:49 
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 

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.