C# Microsoft.Reporting.Winforms RDLC - 如何在正文中添加详细信息部分?
我正在渲染 Winforms.LocalReport,想知道是否可能,以及如何将详细信息/部分添加到报告正文,如 MS Access Report 和 Crystal Reports 中。
组织细节将有助于管理分页符,并且在添加新字段/删除现有字段时更容易进行总体设计。我有 300 多个字段,不包括子报表。
或者,此功能是否已被其他更好的功能取代?感谢任何建议谢谢!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
在访问报告和水晶报告等工具中,我们使用带区(例如详细信息带区、组标题带区等)。然而,在 RDL 中,报表的基础是使用报表报表项(如列表报表项、表报表项、图表报表项和矩阵报表项)。
当您尝试重新创建大多数典型的带状报表时,您可能会发现列表报表项最有用。表 ReportItem 有一个“详细信息行”,您可以添加组,其中每个组都有一组标题行和页脚行。表行不允许像带一样的自由格式布局,但通常我们无论如何都会跨带对齐内容,所以这通常不是问题。
列表 ReportItem 有点像详细信息部分,可能就是您正在寻找的内容。您将列表绑定到您的数据,它将为数据的每一行重复列表的内容(您放置在列表中的文本框、图像等)。如果您愿意,可以嵌套列表以获得与带状报告编写器中的组页眉/页脚部分类似的结果。
每个报表项(表格、图表等)类似于在传统带状报表编写器中使用子报表,但它们更易于使用并且通常更高效(内存更少,运行速度更快)。 ReportItems 允许您在单个报告中轻松使用来自多个数据源的数据。
有关详细信息,请参阅 RDL 规范。
In tools like access reports and crystal reports, we use bands (e.g. detail band, group header band, etc.). However, in RDL the basis of reporting by using ReportItems like the List ReportItem, the Table ReportItem, Chart ReportItem, and Matrix ReportItem.
As you try to recreate most of your typical banded reports, you will probably find the List ReportItems most useful. The Table ReportItem has a "detail row" and you can add groups where each group has a set of header rows and footer rows. A table row does not allow free-form layout like a band, but usually we're aligning things across bands anyway, so this generally isn't a problem.
The List ReportItem is kind of like a Detail Section and is probably what you're looking for. You bind the List to your data and it will repeat the content of the list (the textboxes, images, etc that you place in the list) for each row of your data. If you want you can nest lists to get similar results to group header/footer sections in a banded report writer.
Each ReportItem (table, chart, etc.) is similar to using a SubReport in traditional banded report writers, but they're easier to work with and are generally more efficient (less memory, run faster). ReportItems allow you to easily use data from multiple data sources in a single report.
For more information see the first question in the "Question & Answers" section of the RDL Specification.