Reporting Services ..如何在禁用超链接的情况下导出 Excel 电子表格
我使用 ReportViewer 控件在 WebForm 中显示报告,我还通过调用服务器报告的 Render 方法实现了“导出到 Excel”功能,
例如
ReportViewerControl.ServerReport.Render("Excel",etc,etc,etc);
我的问题是导出的报告包含链接到的超链接其他报告,我希望这些出现在网络表单中,但不会出现,因此在导出的电子表格(由上面的代码生成)中被禁用。
有没有人有办法实现这一点?
谢谢
I'm using the ReportViewer control to display a Report within a WebForm, i've also implemented the "Export to Excel" feature, by calling the Render method of the Server Report
eg
ReportViewerControl.ServerReport.Render("Excel",etc,etc,etc);
My problem is that the exported report contains Hyperlinks that link to other reports, I wish these to appear in the webform but not appear hence be disabled in the Exported Spreadsheet (generated by the Code above).
Does anyone have a way of achieving this?
Thanks
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
报告无法预先了解导出时将采用何种形式。 如果您根据报告导出的格式需要不同的布局,那么您需要为每个布局制作单独的报告。
A report has no advance knowledge of what form it is going to take when exported. If you need different layouts depending on what format the report exports to, then you need to make separate reports for each of those layouts.
只是为了回答我自己的问题,我们最终传递了一个额外的报告参数,并让报告删除链接,然后正常调用渲染。
简单但有效。
Just to answer my own question, we ended up passing an extra report parameter in, and having the report remove the links, and then calling the render as normal.
Simple but it worked.