Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
185
Export Altered WinGrid to Crystal Reports
posted

I allow users to alter the data (sort by Column) of a WinGrid. I would then like to export the altered or sorted version of the data from WinGrid to Crystal Reports.  If I pass the Grid.datasource to Crystal Reports this displays the original or unsorted version of the data from the WinGrid and I need to display the modified version of the data in Crystal Reports.  One thought is to iterate through the entire grid and assign the sorted data to a dataset and then pass the dataset to Crystal Reports. Is there an easier way?

Thanks.

Parents
No Data
Reply
  • 469350
    Verified Answer
    Offline posted

    Hi Scott,

    Sorting the grid doesn't sort the underlying data source. It can't do so, because the grid can only interact with the data source using certain interfaces like IBindingList and this interface does not have any support for sorting. 

    If your data source supports sorting, then you could set the HeaderClickAction in the grid to one of the "external" sort settings.  This means that the grid will not do any sorting - it will simply fire the Before/AfterSortChange event and leave it to you to sort the underlying data source, yourself. That way, the grid and data source would be in synch. 

Children
No Data