7

I'm developing a rdlc report in VS2010 and I need to add a table in the report, but this table has fixed text and doesn't need a datasource. But the report is giving an error because the table isn't related to a datasource. So my question is How do I create table in an rdlc that doesn't need a datsource?

Thanks

roma8716
  • 161
  • 2
  • 3
  • 7

2 Answers2

3

By definition a table needs an associated DataSet.

If you only have one DataSet in a report it can use that by default, otherwise one will need to be specified.

If you don't want to associate the table with a DataSet, you could use one or more independent textboxes placed together to get the same results.

You can embed these textboxes in a Rectangle to keep them together when rendering the report.

Ian Preston
  • 38,816
  • 8
  • 95
  • 92
  • You can embed these textboxes in a Rectangle to keep them together when rendering the report... Sorry, but this approach is so messy it is no even funny. It presents all sorts of layout problems. – tom33pr Feb 03 '20 at 13:02
  • @tom33pr Sorry to say that, but RDLC was never fun nor funny. :-( – Marcel Feb 22 '22 at 14:57
2

If you have fixed values you do not need a Table. Rather, try putting parameters.

In any case, I still suggest you build a DataSet to create a DataTable. Programmatically filling your DataTable is flexible and it would still meet your needs.

For example, your DataTable can contain your fixed values and you can simply attach your DataTable to the report's Datasource. I believe this is your easiest solution.

Alex
  • 4,821
  • 16
  • 65
  • 106
  • @SouhaiebBesbes I have many questions/answers on my profile for reports and such. Feel free to look! http://stackoverflow.com/questions/18787907/how-to-add-two-datatables-to-a-tablix-using-reportviewer-design – Alex Jul 19 '16 at 17:27