从 rdlc 报告的打印/导出中隐藏报告项 [英] Hide a report item from print / export of an rdlc report

查看:42
本文介绍了从 rdlc 报告的打印/导出中隐藏报告项的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个包含多个表的 RDLC,对于每个表,我有一个切换文本框项,可以从报告中隐藏相应的表.它工作得很好,但是,我不希望这些文本框在打印/导出的报告中可见.它们实际上是为了禁用报告中的内容,而不是作为内容本身.有没有办法只在报告的打印版式和导出版本中隐藏这些切换框?

I have an RDLC with multiple tables and for each table, I have a toggle TextBox Item that hides the corresponding table from the report. It works perfectly, however, I don't want these text boxes to be visible in the printed/exported reports. They are really meant for disabling content in the report and not as content themselves. Is there a way to hide those toggle boxes from only Print Layout and exported versions of the report?

我查看了报告文本框的所有属性以及可用于切换可见性的可用表达式,但没有找到可用于隐藏项目的任何内容.有一个 DataElementOutput 属性似乎是我想要的,但我相信它只对 XML 有用.

I looked at all of the properties of the report textbox and at the available expressions that I can use to toggle visibility, but I didn't find anything that I can use to hide the item. There is a DataElementOutput property that seems to be what I want, but I believe that it is only useful for XML.

推荐答案

晚了,但有一个解决方案.您可以在报表中添加一个参数以获取句柄控件的可见性,并在 Print 事件中更改参数值然后刷新报表 (ReportViewer1.RefreshReport())

Late, but there are one solution. You can add a parameter to the report for handle control visibility and in the Print event, change the parameter value and then refresh the report (ReportViewer1.RefreshReport())

这篇关于从 rdlc 报告的打印/导出中隐藏报告项的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆