How to "Choose Report Data..." programmatically.

I am using fastreport from a C# winforms app. I use the the designer control to let the user edit a report template from with my app. When I create the template, I register a data source (DataSet) with the template.

However, the first time the user opens the report template in the designer control, the user needs to go to the

Data=>Choose Report Data...

menu item to choose the report data for the report. I'd like to do that programmatically before the edit the design, to simplify their work.

Can I do that programatically?

Comments

  • you have to buy fastreport license with source code and make your own mods

  • Hello!

    When `report.RegisterData(ds)` is called, the `Enabled` property of the registered tables may be set to `false` by default, which requires the user to open the Data -> Choose Report Data... menu.

    To ensure that all tables are selected (checked) immediately when the report is opened in DesignerControl:

    report.RegisterData(myDataSet);
    foreach (FastReport.Data.DataSourceBase ds in report.Dictionary.DataSources)
    {
    ds.Enabled = true;
    }
    // After that, pass the report to DesignerControl:
    designerControl1.Report = report;
    

    The Data window will then immediately display all tables and their columns without requiring you to manually go to Choose Report Data....

This discussion has been closed.