Using RS.EXE to render SSRS reports

Most of the time RS.EXE is used to carry out administrative tasks like upload/download report, create data source, assign roles etc. For executing the report (rendering) we mostly use Report Manager or applications (Web or Windows). One option that many people don’t consider is using RS.EXE to render the report.

One scenario where I had to use RS.EXE for rendering was when I had to create a tool to do build verification test (Should I call deployment verification? :)) for SSRS. We have a MSI which uses RSS script to deploy a report and set data source. Once it is deployed we had to manually run the report to verify that it renders without any issues. I wanted to automate this rendering part by using RS.EXE.

So I created a RSS script as below

and the command line call as

rs -i e:\test\BVT.rss -s http://MyReportServer/reportserver 

When I ran the command, it had thrown errors like

error BC30002: Type ‘ExecutionHeader’ is not defined.

error BC30002: Type ‘ExecutionInfo’ is not defined.

error BC30456: ‘Render ‘ is not a member of ‘Microsoft.SqlServer.ReportingServices2005.ReportingService2005’.

error BC30456: ‘LoadReport’ is not a member of ‘Microsoft.SqlServer.ReportingServices2005.ReportingService2005’.

 This is because the SSRS web service has two end points, one for management and another for execution. By default RS.EXE uses  the management endpoint to execute the RSS script. You can override this by passing the required endpoint as parameter. In my case I had to call the Execution endpoint to render the report. So the call should have been like

rs -i e:\test\BVT.rss -s http://MyReportServer/reportserver -e Exec2005

Have a look at the below one from MSDN for more detail on SSRS webservice endpoints

http://msdn.microsoft.com/en-us/library/ms155398.aspx

About Suresh Kumar D

Hardcore SQL Developer and aspiring Database Architect.
This entry was posted in SSRS. Bookmark the permalink.

15 Responses to Using RS.EXE to render SSRS reports

  1. Pingback: 2010 in review | Kirukkal a.k.a Scribbling

  2. Apaar says:

    Awesome Suresh….
    Thanks for your Help

  3. Aravind says:

    Thx Suresh.. the steps helped me..

  4. Chitrang Golvelker says:

    Hi Suresh, I am getting the same error. But the difference is I am getting this error even after using the correct end point i.e. Exec2005. Is there any other thing I need to verify or change in order to resolve this error?

    I am struggling with this issue for a week now and badly in need of a fix for this. I would really appreciate any input on this.

    Thanks in advance!
    Chitrang

  5. Rajender says:

    Thanks for very useful post Suresh!!

    We are struggling with another issue around it. Please help us.

    We are executing the report using below script and export report out to Excel file by using rs.Render(“EXCEL”, deviceInfo, extension, _
    mimeType, encoding, warnings, streamIDs)

    rs -i D:\AutomatedReports\Scripts\FInanceReport.rss -s http://MyReportServer/reportserver -l 3000 -t -e Exec2005 -v reportFolder=FInanceReports -v reportOutFolder=D:\AutomatedReports\GeneratedReports >> D:\AutomatedReports\log\Execution.log

    But the out of report is more than 65536 rows. Please suggest on writing the output into the xlsx file so that we can accommodation complete output in one file.

  6. Rajendar,

    Unfortunately SSRS doesnt support exporting to Excel 2007 or higher version. So the only option is to write custom renderer. Please refer the article http://msdn.microsoft.com/en-us/magazine/cc163840.aspx

    Otherwise you can go for a third party tools like Aspose (http://www.aspose.com/reporting-services/excel-component.aspx)

  7. travis says:

    Thanks Suresh!
    This info really should be in the rs.exe script documentation up front!

  8. Valuable info. Lucky me I discovered your web site unintentionally, and I’m surprised why this accident did
    not happened earlier! I bookmarked it.

  9. Simply wish to say your article is as astounding. The clarity for
    your submit is just spectacular and i could suppose you are a professional on this subject.
    Fine with your permission allow me to grab your
    feed to keep up to date with impending post.
    Thanks one million and please continue the enjoyable
    work.

  10. Colby says:

    Very good article. I definitely appreciate this site. Keep it up!

  11. Pingback: Fix Clarity Error Failed To Render Template Windows XP, Vista, 7, 8 [Solved]

  12. Rajender says:

    Hi Suresh,

    How are you doing. Hope all is well with you.

    I have a different question this time. It is not related to this topic. But I am not sure where to post it, hence posting it here. Please move this to different blog, where it fits, if require.

    Below info gives more details about the environment:
    Our application using 2 databases now. One is SQL Server Enterprise 2008 R2 and another one is SQL Server 2005 Enterprise.
    The 2008 R2 is the production database and the data gets replicated to 2005 server using the merge replication at the end of the day. The 2005 database is used more of like a reporting database to get historic data.

    We are using 2005 server extensively for historic data reports and ad-hoc reports (using the Report Builder). This database resides at client’s environment for creating/managing ad-hoc reports by the business users and then create the subscriptions.

    For email subscriptions, we have configured local smtp server IP address at Reporting Services Configuration Manager -> Email Settings.
    The subscriptions are working fine since few years.

    Now the client decided to use the remote SMTP server (i.e. Amazon SES) for triggering subscriptions.

    I have 2 questions:
    1) Since we are planning to move to remote SMTP server (from local client’s SMTP server), which is cost effective and secondly there are subscriptions which are really not required because those users are no longer with the company. At present emails are bouncing to them but we were least bothered because of local SMTP server.
    Now, either we wanted to remove those employ’s subscriptions (users) who are not with the company OR wanted to replace those email addresses with working email address.
    Could you please help us how can we delete those invalid or leftover employees subscriptions from the database.

    2) When we configured remote SMTP server, we are getting following error:
    “ReportingServicesService!emailextension!d!05/04/2016-10:30:19:: Error sending mail, CDO error -2147220978, will not resend
    ReportingServicesService!emailextension!d!05/04/2016-10:30:19:: Error sending email. System.Runtime.InteropServices.COMException (0x8004020E): The server rejected the sender address. The server response was: XXX X.X.XX SMTP; Client was not authenticated to send anonymous mail during MAIL FROM

    at ReportingServicesCDOInterop.MessageClass.Send()
    at Microsoft.ReportingServices.EmailDeliveryProvider.EmailProvider.Deliver(Notification notification)”

    With some research, we came to know that remote SMTP server (which requires authentication), is not supported directly in Reporting Services. The other way to do is to use the SMTP Service in Windows 2003 Server.
    Could you please help us in configuring remote SMTP server?

    It would be great help, if you can help us for these 2 queries.

    Thanks in advance.

  13. Rajender says:

    I forgot to tick both the tick boxes, while posting the comment.
    “Notify me of new comments via email.”
    “Notify me of new posts via email.”

    Please tick then while you reply.

    Thanks.

Leave a reply to Rajender Cancel reply