It contains lots on Business Intelligence scenarios and solutions along with real problems regarding Microsoft Excel, SQL Server Reporting Services, SQL Server Integration & Analysis Services and various databases and also may contain other popular posts.
SQL Server Reporting Services: Schedule printing of the PDF file
I faced one situation in which it was recommended to implement the mechanism for scheduled printing of a PDF file which is captured through the SSRS Windows share subscription. Below is the ticket description -
Ticket Description: Create the
mechanism to schedule the printing of the SSRS reports in PDF format.
Understanding: As per the above description we have
to propose/find out an approach to print the SSRS report in pdf format on
Resolution: The requested functionality will be
implemented by using the batch file
and Windows Task Scheduler/SQL Server Agent.
Batch file sample code:
/*Take to the root*/
/*Get to the installed adobe reader driver, this location may differ based
on the configuration*/
CD Program Files (x86)\Adobe\Reader 11.0\Reader
/*execute the adobe drive file and follow up with the printer properties*/
AcroRd32.exe /t "C:\Users\vipul.sachan\Desktop\Vipul\pdf-sample.pdf"
"HP LaserJet 3055 PCL6 Class Driver" "HP LaserJet 3055 PCL6
Class Driver" "IP_172.16.16.103"
above requirement has been analyzed on 32 bit Microsoft windows operating
is only one pdf file, above methodology will not be supporting in case of multiple pdf files.
Mandatory items: There are following items must be
available into the respective computer system.
reader must be installed to read the PDF file.
must be configured into the source laptop to capture the print command.
SSRS pdf report location which is required to print on scheduled basis.
name, Printer driver, Printer Port
the deployed SSRS report into PDF format using report subscription
the same SSRS pdf report using command line utility which is a batch file
the batch file execution using Windows
Task Scheduler or SQL Job Agent.
Scheduler - Scheduled printing on single SSRS PDF file
Follow the below steps to configure the Windows Task
Task Scheduler by clicking the Startbutton,
clicking Control Panel,
clicking System and Security,
clicking Administrative Tools, and
then double-clicking Task Scheduler.if
you're prompted for an administrator password or confirmation, type the
password or provide confirmation. 2. Click the Action menu, and then click Create Basic Task.
3.Do one of the following:
a.To select a
schedule based on the calendar, click Daily, Weekly, Monthly, or One time,
click Next; specify the
schedule you want to use, and then click Next.
b.To select a
schedule based on common recurring events, click When the computer starts or When I log on, and then click Next.
c.To select a
schedule based on specific events, click When a specific event is logged, click Next; specify the event log and other information using the
drop-down lists, and then click Next.
4.To schedule a program to start automatically, click Start a program, and then click Next.
5. Click Browse to find the program
you want to start, and then click Next.
6. Click Finish.
SQL Server Agent - Scheduled
printing on single SSRS PDF file using
Follow the below steps to configure the SQL Server Agent –
to SQL Server Agent from SQL Management Studio and explore the Job-
click to the jobs and Select new job.
general tab, named the job and select the category as uncategorized (local).
1. Select steps
tab and select new steps. Then
name the step name, select type as Operating
system (CmdExe). In the command open the batch file or write the command.