C# Microsoft.Reporting.Winforms RDLC - how to add detail sections in body?

房东的猫 提交于 2019-12-23 15:58:36

问题


I am rendering a Winforms.LocalReport and would like to know if it is possible, and how to add Detail/Sections to the body of the report like in MS Access Report and Crystal Reports.

Organising into details will help manage page breaks and also general designing easier when adding new / removing existing fields. I have 300 over fields not including subreports.

OR, has this feature been superceded by some other better feature? Appreciate any advice thanks!


回答1:


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.



来源:https://stackoverflow.com/questions/4600252/c-sharp-microsoft-reporting-winforms-rdlc-how-to-add-detail-sections-in-body

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!