将子报表链接到矩阵 [英] Link Subreport to matrix
问题描述
我有一个如下所示的矩阵.列是年份,行是国家/地区.
I have a matrix like below. years on columns and countries on rows.
Countries 2001 2002
US 100 400
UK 200 290
IR 300 89
我需要创建一个显示发票详细信息的子报表.当我在主报告上单击 100 (US-1002) 时,我必须显示所有 100 张发票.我试过这种方式:
I have a requirement of creating a subreport which shows Invoice details. When I click 100 (US-1002) on my main report I have to show all the 100 Invoices. I tried this way:
由于我正在对矩阵中的 InvoiceID 进行计数,因此我尝试在数据测试框操作(转到报告)上使用 Join(Fields!InvoiceID,", ")
表达式.另一方面,我创建了一个带有多值参数的子报表.但是这种方法有效.我发现 Join 不能像预期的数组那样处理数据行.
Since I am doing count for InvoiceID in matrix, I tried using Join(Fields!InvoiceID,", ")
expression on the data test box action(Go to report). On the other side I created a subreport with multivalue parameter. But this approach dint work. I found that Join will not work with data rows as it expect arrays.
后来我使用了 Join(LookupSet(1,1,Fields!Name.Value, "DatasetName"),"/").
我可以加入发票 ID 但问题是,这个表达式加入完整数据集中的所有发票 ID.我只需要 US-2001 单元格 (100) 发票 ID 即可用于我的子报告
Later I used Join(LookupSet(1,1,Fields!Name.Value, "DatasetName")," / ").
I could join the invoice ids but the problem is , this expression joins all the invoice ID in complete dataset. I just need US-2001 cell (100) invoice ids only to take to my subreport
推荐答案
根据您的描述,听起来最简单的方法是将子报表设置为采用两个参数,Country 和年份,而不是尝试传递发票列表.
From your description, it sounds like the easiest thing to do would be to set up the subreport to take two parameters, Country and Year, instead of trying to pass the list of invoices.
然后子报表可以报告特定国家和年份组合的所有发票.
The subreport can then report all the invoices for a particular Country and Year combination.
设置钻取以接受其参数的两个字段会更简单,如上所述,而不是尝试为特定单元格范围内的所有发票计算表达式.
It would be simpler to just set up the drillthrough to accept the two fields for its parameters, as above, instead of try to work out an expression for all the invoices in a particular cell's scope.
这篇关于将子报表链接到矩阵的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!