Databinding DataTable to Report ?

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.




Answer this question

Databinding DataTable to Report ?

  • Ansible

    I was hoping that the Report.Refresh method wouldn't need to be called and the report could act more like a data bound control, where it would update automatically when the data is changed. I don't think it's going to be possible as I read the report stores the data locally within itself and it's not that data thats being bound to.

    Not to worry.

    Thanks for the help folks.



  • Jason Matkowsky

    If you are keeping the same variable for the datatable you should be able to just use the report.refresh() method after you know the data has been updated.
  • Darrell Davis

    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



  • Databinding DataTable to Report ?