When subscription report is generated how to retrieve the parameters and values
-
Monday, July 30, 2012 1:41 PM
I have a subscription reports. The users use web page to enter/select the parameter values for the type of report that they would like to run. When the report is submitted and generated it generates a downloadable file such as pdf or xls or csv depending on user's choice. When users go to download page, I would like to display the file and the parameter values that was generated for the particular report - any suggestion how to do it or sample code? I know how to submit the submit report subscription using rs.FireEvent.
All Replies
-
Monday, July 30, 2012 2:13 PM
To get the parameters and the values entered for a subscription that has been fired you need to query the tabel Execution_log.
This will contain the parameters used for the report.
- Marked As Answer by JohnWeb Thursday, August 02, 2012 2:24 PM
-
Tuesday, July 31, 2012 4:05 PMAppreciate your help. Is this recommend practice or is just some sort of a hack? I notice every version of sql server a new execution log is created - like right now there is ExecutionLog3 for SQL Server 2008 R2 but for 2012 I have not found a new executionlog#. Is there an equivalent method in ReportServer Service API for executionlog?
-
Wednesday, August 01, 2012 9:54 AM
I think the intention of the execution logs is to provide a data source, the log should really be exported to separate database using SSIS and then that database should be used to query the data, the following blog is quite handy
http://www.sqlchick.com/entries/2011/2/6/querying-the-report-server-execution-log.html
-
Wednesday, August 01, 2012 10:42 AMThis looks easy to me. Edit your report and place text box on the report (may be on header) and set the exprassion value for those text box to parameter on your report. Once the report is generated and exported it will have the values of parameter being passed to it. I have done this in my all reports.
Kindly mark the reply as answer if they help
-
Wednesday, August 01, 2012 3:09 PM
Sunil, In my case the external users access the web page which the reports parameters are loaded dynamically and then users select the desired parameters the click submit - is that what you have?. The users are not allowed to run the reports in the report server (i.e http://servername/Reports/Pages/Folder.aspx)reportserver/reports because my site is secured public facing site.
-
Thursday, August 02, 2012 4:16 AM
John,
It will work in that case also. I have same setup and it is working. In anyways end user has to select parameter which ultimately need to reach to report definition to generate the report. So those should get printed on the report.Kindly mark the reply as answer if they help
- Marked As Answer by JohnWeb Thursday, August 02, 2012 2:24 PM
-
Tuesday, August 14, 2012 2:02 PM
Could you provide some code snippets? I'm thinking of using the executionlog instead because I do want to retrieve the reports and parameters that were submitted in past couple weeks to provided users the ability to view on the page the reports they've requested and also be able to download the files that were generated.

