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

 
GeneralMy vote of 1 Pin
luutran.it12-Jan-09 14:36
luutran.it12-Jan-09 14:36 
QuestionCan you send me the source code Pin
c_campos11-Dec-08 5:39
c_campos11-Dec-08 5:39 
GeneralCreation Schedule Pin
yeshkumarg4-Dec-08 20:44
yeshkumarg4-Dec-08 20:44 
GeneralWant to know more about Daily Schedule Pin
Sangmeshwar patil19-Nov-08 20:07
Sangmeshwar patil19-Nov-08 20:07 
GeneralShare code Pin
CaptainJackSparrow18-Nov-08 0:48
CaptainJackSparrow18-Nov-08 0:48 
GeneralShare code Pin
TitoPeru14-Nov-08 6:09
TitoPeru14-Nov-08 6:09 
GeneralPlease send me code. Pin
ashu21813-Nov-08 18:10
ashu21813-Nov-08 18:10 
GeneralSource code Pin
reidarmail16-Sep-08 23:41
reidarmail16-Sep-08 23:41 
This is a great article! Can I have a copy of the latest source code?

My email: reidarmail@gmail.com

Thanks.
GeneralSource Code, please Pin
Boris Skylar20-Aug-08 5:03
Boris Skylar20-Aug-08 5:03 
Generalsource code Pin
golden child16-Jul-08 13:19
golden child16-Jul-08 13:19 
GeneralSource Code Pin
devkd15-Jul-08 6:06
devkd15-Jul-08 6:06 
GeneralSource Code Pin
Dany Sovevany2-Jul-08 4:00
Dany Sovevany2-Jul-08 4:00 
GeneralPlease share the source code Pin
nazreimam18-Jun-08 18:40
nazreimam18-Jun-08 18:40 
GeneralSource code Pin
Jon Chen16-Jun-08 4:46
Jon Chen16-Jun-08 4:46 
GeneralSource code please Pin
qamelie1-Jun-08 13:48
qamelie1-Jun-08 13:48 
GeneralSource Pin
Member 115391729-May-08 7:33
Member 115391729-May-08 7:33 
GeneralCode Please Pin
Member 131357324-May-08 0:33
Member 131357324-May-08 0:33 
GeneralPlease Send Code Pin
jerry jerry21-May-08 6:26
jerry jerry21-May-08 6:26 
GeneralPlease send code Pin
Paul Faint10-May-08 22:16
Paul Faint10-May-08 22:16 
GeneralPlease send code Pin
mhenry20252-May-08 9:00
mhenry20252-May-08 9:00 
GeneralPlease send code Pin
rye69uk4-Jan-08 1:52
rye69uk4-Jan-08 1:52 
GeneralHelp Pin
ashueng30-Oct-07 23:50
ashueng30-Oct-07 23:50 
Questionserver scheduling Pin
ashueng30-Oct-07 20:20
ashueng30-Oct-07 20:20 
AnswerRe: server scheduling Pin
Soshan Fernandes31-Oct-07 8:11
Soshan Fernandes31-Oct-07 8:11 
GeneralCode Pls Pin
Vallatheril24-Oct-07 1:24
Vallatheril24-Oct-07 1:24 

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.