开发者

Dynamic columns in C# rdlc report

开发者 https://www.devze.com 2023-02-10 01:09 出处:网络
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

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.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号