1
votes

One of the reports I am creating has dynamic number of columns - a datatable gets returned from the stored procedure, the number of columns depend on the number of items defined in the database (one column for each item, other than some fixed columns).

Is it possible for me to use RDLC report to generate a report in this case? All the calculations are already done int he report, I am looking at RDLC only for the sake of export to excel/pdf and repeating header/footer.

4

4 Answers

1
votes

It is possible, but there is no simple solution. Here is a link to a former answer of mine on this topic.

An additional investigation later

Here is an article describing the mentioned report generation with a self generated RDL object model in detail.

0
votes

From the sounds of it, you want your report to pivot defined items, which can change with respect to various report criteria. If you know all the columns that COULD come back, you could just define your RDL to bind them all but hide the ones that aren't item defined. You would just have to bind the Visible property of the column to a determination of whether the has been defined.

0
votes

For your Problem,

I guess you can go for matrix instead of tables. where you can generate rows and columns dynamically according to the data you are getting.

Check here for using of matrix

0
votes

Use matrix in RDLC whenever your columns are not fixed in datatable.

Visit http://www.gotreportviewer.com/matrices/

Here you'll find use of both table and matrix in RDLC. See yourself which one suits for your requirement.