简体   繁体   English

如何仅显示SSRS中的两个Tablix之一?

[英]How to display only one of the two tablix in SSRS?

I am very new to SSRS. 我对SSRS非常陌生。 I want to develop a report. 我想编写一份报告。 Which has 2 options and you can select either of 2. First option is selection by OrderID and another option is selection by DepartmentName. 其中有2个选项,您可以选择2个。第一个选项是按OrderID选择,另一个选项是按DepartmentName选择。 If you select Option 1 then the report displays a table with the columns related to Order details. 如果选择选项1,则报告将显示一个表格,其中包含与订单明细相关的列。 If you select Option 2 then the report displays a table with the columns related to Department. 如果选择选项2,则报告将显示一个表格,其中包含与Department相关的列。 Only one table will be displayed at a time. 一次仅显示一个表格。

How can I achieve this, do I need to use a sub report for the 2. 如何实现此目标,我需要为2使用子报表吗?

There are many ways you could go about this. 很多方法可以解决此问题。 A by-no-means-complete list: 一个不完整的清单:

  1. Create 2 reports, don't even attempt to merge them. 创建2个报告,甚至不要尝试合并它们。 Frankly this makes the most sense; 坦率地说,这是最合理的。 you're laying the foundations for a maintenance nightmare when you start trying to make these "omni-reports" that contain multiple presentations of data, and wonky navigation/visibility rules. 当您开始尝试制作包含多个数据表示以及不稳定的导航/可见性规则的“全能报告”时,就为维护噩梦奠定了基础。

  2. Create a report with two tables, one per dataset. 创建一个包含两个表的报告,每个数据集一个。 Link the visibility property of each table to the relevant parameter. 将每个表的可见性属性链接到相关参数。

  3. Create a master report that calls the appropriate subreport based on a parameter. 创建一个主报表,该主报表基于参数调用适当的子报表。 This isn't quite as simple as it sounds, but it's also not too complicated. 这听起来并不简单,但也不太复杂。 You're going to need to write an expression to dynamically choose the subreport, and both subreports will need to accept the same parameter set. 您将需要编写一个表达式来动态选择子报表,并且两个子报表都需要接受相同的参数集。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM