Datatable as datasource in ReportViewer

后端 未结 1 375
长发绾君心
长发绾君心 2020-12-20 07:30

I want the table component in reportviewer control to be filled in with data from datatable. In other words, i want to use datatable as source for reportviewer control. I tr

相关标签:
1条回答
  • 2020-12-20 08:22

    The overload you're using for the constructor of the ReportDataSource object is expecting the name of the data source in that first parameter. You're not supplying this, you need the DataTable name.

    Update your code to this and you should be OK:

    ReportDataSource source = new ReportDataSource("DataTable1", dt);
    
    0 讨论(0)
提交回复
热议问题