RS 2008: Export to Excel and Sub Reports
Hi All, Whats the best way without creating a seperate report to export a report without the sub report details, or have the option to include or not inlude the sub report in the export. The reason for this is the filtering in excel, the sub report has different columns to the main report so filtering on an export isnt possible without deleting each line that the sub report displays in excel. ThanksPete
December 29th, 2010 7:26am

Pete, As per as my knowledge, creating a subreport would be easier for this scenario. if you want to export in excel then you need to create the List report and use subreport in to it. Cheers, Sandip...
Free Windows Admin Tool Kit Click here and download it now
December 29th, 2010 2:42pm

Hi Pete, In SQL Server Reporting Services 2008, you can use a textbox with "go to URL" action to export the separate report without sub report, please follow these steps: 1. Create a separate report without sub report. 2.Drag a textbox to the main report. If necessary, you can set the textbox value to prompt user, e.g. "Click here to export report to Excel". 3.Right click the textbox, and then click "Text Box Properties". In Text Box Properties window, switch to action tab, check the "Go to URL" radio button. 4.In the "Select URL" expression, input the separate report URL, such as: ="http://localhost/reportserver$albertye_2k8?/BlankReport/SubReport&rs:Command=Render&rs:Format=EXCEL" Please note that if you input a wrong URL, it could not be click. And it's very important to add the URL parameters "rs:Command=Render", "rs:format=Excel”, and the parameters of the separate report to URL. When user click the textbox, user will download the separate report without sub report. About the "go to URL" expression, you can take this as reference: http://msdn.microsoft.com/en-us/library/ms153586(v=SQL.100).aspx In addition, if possible, you can upgrade your SQL Server Reporting Services to 2008 R2. In SQL Server Reporting Services 2008 R2, there is a built-in field "RenderFormat.Name" can determine the render name. You can use it in visibility expression to hide sub report when you export the main report. For example, you can set the visibility of the sub report to an expression: =(Globals!RenderFormat.Name="EXCEL") When user export the main report to Excel, then the expression will return true and the sub report will not be export to Excel. If there is anything unclear, please feel free to ask. Thanks, Albert Ye
January 2nd, 2011 10:20pm

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics