Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Best way to dynamically create RDLC xml as input to VS2005 Report Viewer?

What is the best way to dynamically create RDLC xml as input to VS2005 Report Viewer?

I would like to autosize columns based on the data sizes. I would also like to programmatically control what columns are displayed.

like image 568
Kerry Jenkins Avatar asked Dec 07 '25 04:12

Kerry Jenkins


2 Answers

Lisa Nicholls gives a complete answer in this thread about dynamically defining a report. You'll want to scroll down some before you get to a useful answer. This thread most directly answers your question about controlling which columns are displayed.

These same techniques can be used to size the columns programmatically, but your code will have to figure out the appropriate column widths.

like image 69
hurcane Avatar answered Dec 08 '25 19:12

hurcane


Dan Smith also has a good solution at: http://csharpshooter.blogspot.com/2007/08/revised-dynamic-rdlc-generation.html

Majid also has a refinement of Dan's solution in the comments to that blog entry that doesn't need to write any files to the file system.

like image 40
Brian Hinchey Avatar answered Dec 08 '25 19:12

Brian Hinchey