如何在运行时更改子报表源?
我正在用 C# 创建一些报告,有两种类型。页眉和页脚相同,但中间部分不同。我有一个类型参数来确定它是哪种类型的报告。但我不知道如何更改源子报表。不幸的是,“使用此报告作为子报告”字段不允许输入表达式,因此我无法按条件定义必要的报告。我不知道如何从代码中做到这一点。
I'm creating some report in C# and I have 2 types of them. The header and footer are the same but the middle part is different. I have a type parameter to determine which type report is it. But I don't know how to change the source subreport. The field "Use this report as subreport" unfortunately doesn't allow to enter the expression so I cannot define the necessary report by condition. And I don't know how to do that from the code.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我找到了解决方案。只需将 2 个不同的子报表放在主报表上,并使用表达式来确定应显示哪一个,隐藏哪一个。愚蠢但有效。
I've found the solution. Just put 2 different subreports on the main report and use expression to determine which one should be shown, which - to be hidden. Stupid but works.