简体   繁体   English

SSRS 报告在列表中为每个参数值重复 tablix

[英]SSRS Report Repeat tablix inside list for each parameter value

I have a tablix that I want to have repeated for each value of a parameter.我有一个 tablix,我想为参数的每个值重复。 Basically the parameter consists of a list of currencies and I want the tablix to be generated for each currency.基本上该参数由货币列表组成,我希望为每种货币生成 tablix。 It's the same table each time just filtered for a different currency for each of the parameter values.每次都是同一张表,只是为每个参数值过滤了不同的货币。 Each copy of the table has to be on it's own page so that when the user exports to excel each sheet is for a different currency.表格的每个副本都必须在它自己的页面上,这样当用户导出到 excel 时,每个表格都用于不同的货币。

I tried to use this solution: SSRS report repeat table for every parameter value我尝试使用此解决方案: SSRS report repeat table for each parameter value

So I have two datasets, dsList and dsTablix.所以我有两个数据集,dsList 和 dsTablix。

The problem is once I put the tablix control inside the list control the tablix dataset gets set to dsList and I can't change the tablix's dataset back to dsTablix.问题是,一旦我将 tablix 控件放在列表控件中,tablix 数据集就会设置为 dsList,并且我无法将 tablix 的数据集更改回 dsTablix。 Now the report doesn't run at all because the tablix refers to fields from dsTablix but it's dataset property is set to dsList.现在报告根本不运行,因为 tablix 引用了来自 dsTablix 的字段,但它的数据集属性设置为 dsList。

How do I keep the tablix pointing to dsTablix while it's inside of a list?当 tablix 在列表中时,如何让 tablix 指向 dsTablix?

You don't need to put one tablix inside another to achieve this.您不需要将一个 tablix 放在另一个 tablix 中来实现这一点。

Assuming your dsTablix dataset query looks something like this假设您的 dsTablix 数据集查询看起来像这样

SELECT * FROM myTable WHERE CurrencyID in (@CurrencyID)

Then simply add a tablix, add as many details rows as you need to display all the data and set the textbox to whatever you need.然后只需添加一个 tablix,添加尽可能多的详细信息行以显示所有数据并将文本框设置为您需要的任何内容。

Then just add a rowgroup that groups on CurrencyID (or whatever fields you need to split by) .然后只需添加一个按CurrencyID (或您需要拆分的任何字段)分组的行组。 In the rowgroup properties set page breaks to 'between each instance'.在行组属性中,将分页符设置为“在每个实例之间”。 You can also set the page name in the group property to whatever you want and this will be the sheet name in Excel.您还可以将组属性中的页面名称设置为您想要的任何名称,这将是 Excel 中的工作表名称。 So you might set the page name to something like =Fields!CurrencyName.Value因此,您可以将页面名称设置为=Fields!CurrencyName.Value

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

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