我添加到 DataSet 中的表中的数据未显示在 XtraReport 中
我的数据集中有一个表,是在 Visual Studio 2010 的数据集设计视图中创建的。然后在我的 XtraReport1
类中,我有一些引用这些表列的标签。一开始这个表是空的。当程序运行时,该表填充数据,然后我在代码中创建一个新的 XtraReport 并调用 .ShowPreviewDialog()
来显示报告。但它是空的,没有错误。我哪里不明白?
XtraReport1 report = new XtraReport1();
report.ShowPreviewDialog();
我想当我在代码和 ShowPreviewDialog 中新建 XtraReport 时,XtraReport 在这个特定时间查看数据集并获取其数据。我错了吗?我确信 XtraReport 使用的表充满了数据,因为我在 GridView 中准确地显示了其数据 - GridView 有数据,但 XtraReport 没有!
I have a table in my dataset that I create it in dataset design view in Visual Studio 2010. Then in my XtraReport1
class I have some labels that refer to these table columns. At the beginning this table is empty. When program is run, this table fill with with data, and then i make a new XtraReport in my code and call .ShowPreviewDialog()
for it to show report. But it's empty and there is no error. Where i don't understanding ?
XtraReport1 report = new XtraReport1();
report.ShowPreviewDialog();
I think when I new up a XtraReport in my code and ShowPreviewDialog
, in this specific time XtraReport look at dataset and get its data. Am I wrong? I'm sure that table that XtraReport is using is full with data because I show its data in exact time in a GridView - the GridView has data but the XtraReport doesn't!!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
答案是 Davide Piras 在评论中所说的:您没有将数据表与报表对象关联。在调用 showpreview 之前将其分配给报告数据源
Answer is what
Davide Piras
said in comment : You are not associating the datatable to the report object. before calling the showpreview assign it to the report datasource