将DataTable数据绑定到报告? [英] Databinding DataTable to Report ?

查看:97
本文介绍了将DataTable数据绑定到报告?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述


我创建了一个以windows形式显示的水晶报表。报告显示在选项卡中,其中包含另一个选项卡上的数据输入控件。数据输入控件绑定到数据表。在运行时,我将数据源设置为控件绑定的相同DataTable。想法是,如果用户编辑数据表,则报告将更新。


虽然不行。所以我的问题是,如何将Crystal Report绑定到数据源,以便在数据源发生变化的情况下报告呢?


任何帮助表示赞赏。

解决方案

您好


我认为它可以自动完成......您必须清除数据表中的预置数据..fill使用新数据表进行报告并刷新


所以在更改编辑选项卡中的数据表后,根据需要进行更改


Report.Database.Tables [1] .SetDataSource(null);


Report.Database.Tables [1] .SetDataSource(prize);


Report.Refresh();


希望它有帮助



Hi,

I've created a crystal report that I display in a windows form. The report is displayed in a tab with the data entry controls on another tab. The data entry controls are bound to a data table. During runtime I set the data source to the same DataTable that the controls are bound to. The idea is if the user edits the data table then report will update.

It's not working though. So my question, how do you bind a Crystal Report to a data source so that if the data source changes so does the report?

any help appreciated.

解决方案

Hi

I think it can be done automaticly ... u have to clear preveous data in data table ..fill reports with new datatable and refresh it

so after the changing the datatable in edit tab and accpet the changes u have to

Report.Database.Tables[1].SetDataSource(null);

Report.Database.Tables[1].SetDataSource(prize);

Report.Refresh();

hope it will helps

 


这篇关于将DataTable数据绑定到报告?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆