Click here to Skip to main content
15,745,746 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I am trying to generate a RDLC report in ASP.NET where the columns of my Dataset will be dynamic and determined only at run time.

I have a made a function that returns a DataTable, and by selecting this function in the RDLC report wizard, I can generate my report successfully.[^]

But, if I make a slight change to the function so that my datatable is truly dynamic, by populating columns from the database, my function then does not show up in the report wizard.

This is my changed function[^]

You see, the only change I have made to the function is querying from the database and generating the report dataset columns within the loop that iterates through database data. But due to this change, my function does not show up in the Report Wizard. If I omit the code, it shows up again.

I can use this function to generate a GridView nicely, but the problem is with RDLC reporting.

My objective is to generate the report datatable using database results. Please help me.
Updated 28-Mar-23 6:22am
Jignesh Khant 9-Mar-15 1:54am    
You can use matrix to display your data. Matrix dynamically creates coloumns based on your datatable.

1 solution

I'm looking for a depurated solution, I lost my old examples, but I suggest to view following:

I hope helps you.
Share this answer

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900