reportviewer control with dynamic data source RRS feed

  • Question

  • User152990470 posted

    Good day, i would like to know if it is possible to have a rdlc file with a dynamic data source, my sql is generated dynamically on this page and i am currently diplaying the results in a gridview control but would like to display it in a reportviewer control.


    Any help would be greatly appreciated!

    Tuesday, August 23, 2011 8:07 AM

All replies

  • User-830595639 posted


    You can pass your query to rdl file as a parameter and there in the dataset just set the value with this parameter. You need to sure that each query will produce the same name and same number of column.

    Hope this will help you.



    Wednesday, August 24, 2011 3:18 AM
  • User152990470 posted

    Hi Nishantg, thank you for the response i didnt know this was possible and will look into it, unfortuanely what i am trying to do is build a dynamic report system wich uses different tables and columns, this works fine with gridview because i can just assign the datasource on the fly.

    Can you give me any advice or point me in the right direction, would it help if i create the rdlc file dynamically?


    Thanks again

    Wednesday, August 24, 2011 3:38 AM
  • User-830595639 posted

    Hi Eisbein,

    Ya you can do this with your gridview, but you can't do it with Report. As Report needs to know about all the columns which it needs to diplay in table or matrix. There is one work around for it, you need to develop different reports for all possible combination and then you can call them accordingly, but as I said earlier its not possible to change the column name at the runtime in Report.

    Wednesday, August 24, 2011 6:05 AM