Search code examples
c#winformsdynamicrdlcdynamic-rdlc-generation

RDLC report with no database in winforms


Hi i want to create a rdlc report with a table in it such that the table have two columns. the first columns is hard coded during design and describe label of values in next column. The next column should be filled by values coming at run time. Report format

.Creating this table with no database gives me error that

"the tablix "table1" refers to an invalid dataset name which does not exist"

Is there anyway to fill values in next column without creating a data set?

if not then can/how I create a mock data base but values in column still be filled by parameters?


Solution

  • You can add a empty dataset to your reports like this:

    Add a object DataSet to your report if there aren't any, the object can be anything as this does not matter.

    enter image description here

    Then add these line before rending the report:

    ReportDataSource rdl = new ReportDataSource("DataSet1", new List<string>());
    ReportViewer1.LocalReport.DataSources.Add(rdl);