RDLC子报表仅显示一行记录 [英] RDLC Subreport only display one row of record

查看:637
本文介绍了RDLC子报表仅显示一行记录的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个rdlc子报告。从数据库中检索完所有记录后,记录将显示在子报表内的Tablix中。我有10行记录,但是当它们被传递到子报表时,它只显示第一条记录。

后续记录将消失,不会显示。



我检查了tablix的属性,我没有在表达式中使用First。无论如何我可以解决这个问题吗?



以下是我将代码传递到子报告的代码。



Hi, I have a rdlc subreport. After I have retrieved all the records from database, the records will be displayed in a tablix inside the subreport. I have 10 rows of records, but when they are being passed to the subreport, it only displays the first record.
The subsequent records will disappear and would not be displayed.

I have check the properties of the tablix, I did not use "First" in the expression. Anyway I could solve this?

Below are my codes to pass the records into the subreport.

long containerHeaderId = _unitDtoList.ContainerHeaderId;
//Get the report datasources from here
ReportDataSource[] reportDataSources = new ReportDataSource[2];
reportDataSources[0] = GetUnitContainerGenealogyInquiryData(_parentUnitDtoList.DtoList[_count]
                                     ,      DataTypeConversion.StringToLong(e.Parameters[0].Values[0])
                                     , containerHeaderId);

DataSet dsTrackedBy = ToDataSet(_unitGenealogyTrackedByDetails);
reportDataSources[1] = new ReportDataSource(ConstantReference.Reports.ReportDatasourceUnitGenealogyBarcodeTrackedByDetail, dsTrackedBy.Tables[0]);

//Display the report in report viewer
foreach (var dataSource in reportDataSources)
{
     e.DataSources.Add(dataSource);
}

推荐答案

在子报表的设计上,您是否在具有唯一ID的字段上有父组?根据我的经验,您需要某种行编号(即每行数据的唯一ID)。请参阅此处的解决方案(项目符号2):

http: //forums.asp.net/t/2051242.aspx?ReportViewer+shows+only+first+record [ ^ ]
On the design of the subreport, do you have a parent group on a field that has a unique ID? In my experience you need a "row" number (i.e. a unique ID for each row of data) of some kind. See solution (bullet 2) here:
http://forums.asp.net/t/2051242.aspx?ReportViewer+shows+only+first+record[^]


这篇关于RDLC子报表仅显示一行记录的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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