询问者
C# winform中添加rdlc报表,在报表控件中无法连接数据源

问题
全部回复
-
Hi,
你又没说链接到数据库上面? 如果没有数据,一方面没有链接成功,一方面显示出现问题,你有尝试debug你的代码吗?
这边是微软的人写的一个demo。关于如何使用rdlc
https://code.msdn.microsoft.com/windowsdesktop/RDLC-Report-in-C-b106fc20
Best Regards,
Hart
Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.
- 已建议为答案 Hart WangModerator 2017年3月17日 7:36
-
Hi Hart,
我试了你给我的参考链接,如果我新建一个项目,按照步骤,可以成功选择数据源并生成报表。非常感谢!但是如果我在原来的项目中按照步骤操作,仍然无法选择数据源和生成报表。我原来项目中有关于数据库的查询添加等操作,可以成功实现。这是不是说明数据库连接是成功?我还发现了一个问题:我在项目解决方案中添加报表项的时候,会自动弹出建立新的数据集对话框,名称一栏默认为“DataSet1”,但是下面数据源选择的时候,下拉框中备选项是我之前建立的数据集,名称为“greenhouse_DataSet”,我需要将这两者统一吗?同一个数据连接可以有多少个数据集?我感觉我好像把数据集搞乱了。请你再帮我看看是什么原因,不胜感激!
谢谢!
-
Hi,
>>" 我原来项目中有关于数据库的查询添加等操作,可以成功实现。这是不是说明数据库连接是成功? "
能插入成功说明,数据库已经连接上。
我觉得你不需要合并这两个数据集。
>>" 仍然无法选择数据源和生成报表 "
你有尝试建立一个测试报表,放到数据库中,在进行测试。
Best Regards,
Hart
Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.
- 已建议为答案 Hart WangModerator 2017年3月17日 7:36