views:

1188

answers:

2

Is it possible to hide or exclude certain data from a report if it's being rendered in a particular format (csv, xml, excel, pdf, html). The problem is that I want hyperlinks to other reports to not be rendered when the report is generated in Excel format - but they should be there when the report is rendered in HTML format.

A: 

I don't think this is possible in the 2000 version, but might be in later versions.

If I remember right, we ended up making two versions of the report.

Bob Dizzle
+2  A: 

The way I did this w/SSRS 2005 for a web app using the ReportViewer control is I had a hidden boolean report parameter which was used in the report decide if to render text as hyperlinks or not.

Then the trick was how to send that parameter value depending on the rendering format. The way I did that was by disabling the ReportViewer export controls (by setting its ShowExportControls property to false) and making my own ASP.NET buttons for each format I wanted to be exportable. The code for those buttons first set the hidden boolean parameter and refreshed the report:

ReportViewer1.ServerReport.SetParameters(New ReportParameter() {New ReportParameter("ExportView", "True")})
ReportViewer1.ServerReport.Refresh()

Then you need to programmatically export the report. See this page for an example of how to do that (ignore the first few lines of code that create and initialize a ReportViewer).

Liron Yahdav
I agree with this post. The only method I know of is to use a report parameter and then set an expression on the table or matrix cell that references to the parameter to determine whether or not it should return a hyperlink.
Registered User