简体   繁体   中英

Dynamic columns in C# rdlc report

Suppose I have a report that lists employees (as rows) with their respective taxes charged (in columns). It is possible for a new tax to come up. Since my rdlc report file is currently designed (from XML of-course) to statically generate the columns. A future shift in events will need me to alter the rdlc file and add in a new column. How can I do this dynamically? I intend to avoid opening the rdlc file and adding XML code.

The best option is to simply do it manually, since it does not seem to happen often. Especially if you are using the RDLC editor in VS2008.

You can use the Matrix control instead of the Table control. Matrix will - based on grouping - generate the appropriate columns and rows. You will have to modify your query and it will be a bit slower as well.

You can use the Table or List control with parametrically hidden columns.

You can automatically modify the report's XML based on how many columns you need. Since RDLC is an xml file, it is trivial.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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