Create table without dataset in a rdlc report.

牧云@^-^@ 提交于 2019-12-23 09:01:03

问题


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


回答1:


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.




回答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.



来源:https://stackoverflow.com/questions/16969839/create-table-without-dataset-in-a-rdlc-report

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!