Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Generate report from URL - SQL Server Reporting Services 2008

I have SQL Server Reporting Services 2008 and when I open the following URL:

"http://localhost/Reports/Pages/Report.aspx?someReport"

I'm getting report screen in which I fill my parameters and generate a report,

My question is how can I do this without any GUI? by batch file or C# script..

Thanks in advance.

=========================================================================

EDIT:

Thanks to all answer above I succeed to generate a report and save it as an XML using the following link:

"http://Server/ReportServer/Pages/ReportViewer.aspx?someReport&dFrom=01/01/2012&dTo=08/08/2012&rs%3AFormat=XML"

Thanks for you all!!!

like image 416
Dor Cohen Avatar asked Aug 07 '12 12:08

Dor Cohen


2 Answers

Your problem is you are passing parameters to http://server/reports... you need to pass parameters to http://server/reportserver...

I remember this issue I had when I first started using Reporting Services.

Here's the MSDN that may help you: http://msdn.microsoft.com/en-us/library/ms155391.aspx

For example, to specify two parameters, “ReportMonth” and “ReportYear”, defined in a 
report, use the following URL for a native mode report server:

http://myrshost/ReportServer?/AdventureWorks 2008R2/Employee_Sales_Summary_2008R2&ReportMonth=3&ReportYear=2008

The result is like so:

http://myRSServer/ReportServer/Pages/Report.aspx?%2fDefaultTenant%2fDialing+Reports%2fDialing+Agent+Performance&dFrom=01/01/2012&dTo=08/08/2012

If you want to export the report to excel / pdf / etc you can append it:

For excel: &rs:Format=Excel

For PDF: &rs:Format=PDF

This should help as well: http://www.mssqltips.com/sqlservertip/1336/pass-parameters-and-options-with-a-url-in-sql-reporting-services/

like image 173
JonH Avatar answered Oct 04 '22 16:10

JonH


Your second URL option is the closest, you pass the date parameters without quotes. As JonH states you want to use ReportServer instead of Reports, and you also want to remove ItemPath=

http://Server/ReportServer/Pages/Report.aspx?%2fDefaultTenant%2fDialing+Reports%2fDialing+Agent+Performance&dFrom=01/01/2012&dTo=08/08/2012

Additionaly, if you want to export the file you can append &rs:command=render&rs:format=PDF replacing PDF with the format you desire

like image 27
msmucker0527 Avatar answered Oct 04 '22 16:10

msmucker0527