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 retur
I am not sure your question is framed too elegantly. It is not possible to create a truly ad-hoc report. The work around is this. - Create the rdlc file - Create a dataset xsd file in the format you would get your data from. You will have to do this manually and each column should match your eventual output - Bind the rdlc file to this dataset datasource - Design your report
Now in the query generating part, you have to bind the dynamic data to the rdlc like this
Dim repDS As New Microsoft.Reporting.WebForms.ReportDataSource
repDS.Value = dT
repDS.Name = "dsConsolReq_dt1" 'hard coded here, but you should get it dynamically perhaps from the querystring or the db
RV1.LocalReport.DataSources.Clear()
RV1.LocalReport.DataSources.Add(repDS)
RV1.LocalReport.ReportPath = "Reports\rep_itemr1.rdlc" 'same again, use dynamic values
RV1.ProcessingMode = Microsoft.Reporting.WebForms.ProcessingMode.Local
RV1.LocalReport.Refresh()
The key here is the NAME of the report data source. It should exactly match the dummy dataset/datatable that you created for designing your report