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.
如果某些数据以特定格式(csv,xml,excel,pdf,html)呈现,是否可以隐藏或排除某些数据。问题是,当报表以Excel格式生成时,我希望不会呈现指向其他报表的超链接 - 但是当报表以HTML格式呈现时,它们应该存在。
2 个解决方案
#1
3
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.
我使用ReportViewer控件为Web应用程序执行SSRS 2005的方式是我有一个隐藏的布尔报表参数,在报表中使用该参数决定是否将文本呈现为超链接。
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:
然后诀窍是如何根据渲染格式发送该参数值。我这样做的方法是禁用ReportViewer导出控件(通过将其ShowExportControls属性设置为false)并为我想要导出的每种格式创建自己的ASP.NET按钮。这些按钮的代码首先设置隐藏的布尔参数并刷新报告:
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).
然后,您需要以编程方式导出报表。有关如何执行此操作的示例,请参阅此页面(忽略创建和初始化ReportViewer的前几行代码)。
#2
0
I don't think this is possible in the 2000 version, but might be in later versions.
我不认为这在2000版本中是可能的,但可能在更高版本中。
If I remember right, we ended up making two versions of the report.
如果我没记错的话,我们最终制作了两个版本的报告。
#1
3
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.
我使用ReportViewer控件为Web应用程序执行SSRS 2005的方式是我有一个隐藏的布尔报表参数,在报表中使用该参数决定是否将文本呈现为超链接。
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:
然后诀窍是如何根据渲染格式发送该参数值。我这样做的方法是禁用ReportViewer导出控件(通过将其ShowExportControls属性设置为false)并为我想要导出的每种格式创建自己的ASP.NET按钮。这些按钮的代码首先设置隐藏的布尔参数并刷新报告:
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).
然后,您需要以编程方式导出报表。有关如何执行此操作的示例,请参阅此页面(忽略创建和初始化ReportViewer的前几行代码)。
#2
0
I don't think this is possible in the 2000 version, but might be in later versions.
我不认为这在2000版本中是可能的,但可能在更高版本中。
If I remember right, we ended up making two versions of the report.
如果我没记错的话,我们最终制作了两个版本的报告。