Reputation: 59466
I need to display some tabular data in an RDLC which is not sourced from any dataset. I need the table only for formatting purposes. So I created the table and designed it around my content (which is passed in via parameters).
Now I get a compile time error saying:
"error rsDataRegionWithoutDataSet: The tablix ‘Tablix1’ is in the report body but the report has no dataset. Data regions are not allowed in reports without datasets."
How do I go about displaying unbound tabular data in an RDLC based report?
Upvotes: 0
Views: 3931
Reputation: 600
To add a dummy dataset:
Add this in your code near where you add your parameters:
report = new LocalReport();
...
report.DataSources.Add(new Microsoft.Reporting.WebForms.ReportDataSource("DataSet1", new DataTable()));
...
report.Refresh();
Upvotes: 1
Reputation: 1687
You should use a dummy dataset to bind to the matrix, because table requires to be bound to a dataset.
Otherwise what I would to do what you are looking for is to use textboxes and place them together, you'll get the same result. And If you need to keep them together (in case of a page break) you could embed the textboxes inside of a rectangle.
Upvotes: 0