C1FlexReport: Use DataSet as Datasource

Posted by: rafael.riveratorres on 26 October 2023, 7:16 pm EST

  • Posted 26 October 2023, 7:16 pm EST

    Hi,

    In Winforms NET CORE6 (VBNET), we are trying to migrate from rldc reports to C1FlexReports and we are having doubts about how to pass our data to a report definition.

    Can we pass to the C1FlexReport multiple DataTables or multiple Lists Of Objects? And then, how do we declare these Objects/Datatables as DataSources in the C1FlexReportDesigner so that it knows what it is working with, and it can apply agreggations and grouping over the data(shown in a table like manner)?

    In the C1FlexReportDesigner is it possible to use a DataSet file (.xsd) as a DataSource?

    Your help will be greatly appreciated.

  • Posted 27 October 2023, 8:17 am EST

    Hi,

    1. To pass your data to FlexReport you can add a DataSource in FlexReport’s DataSources and set it as the main DataSource for FlexReport as follows:
    C1FlexReport1.DataSources.Add(New C1.Win.FlexReport.DataSource With {
        .Name = "ConnectionString",
        .DataProvider = C1.Win.FlexReport.DataProvider.OLEDB,
        .ConnectionString = GetConnectionString(),
        .RecordSource = "select * from Appointees",
        .RecordSourceType = C1.Win.FlexReport.RecordSourceType.Text
    })
    C1FlexReport1.DataSourceName = "ConnectionString"

    Please refer to the attached sample for implementation (FlexReport60VB_DataSource.zip).

    1. To see how multiple DataSources work in FlexReport, please refer to Connect to Multiple Data Sources in docs.

      You can also refer to the “MultiDataSource” report for the implementation of Multiple DataSources and the “Aggregates” report for the implementation of Aggregates (Reports.zip).

    2. Yes, you can use the .xsd file as the DataSource to define the schema in the FlexReportDesigner by following the steps shown in the attached video (XsdInDesigner.zip)

    Best Regards,

    Kartik

  • Posted 30 October 2023, 9:12 am EST - Updated 30 October 2023, 9:17 am EST

    Hello,

    I have similar doubts with multiple data sources. I want to have multiple grids with different dataTables. When I try to bind to the second datasource is not possible. If I enter to the edit mode of the expression I see that only the parameters of the first datasource is available.

  • Posted 31 October 2023, 4:41 am EST

    Hello christian,

    In FlexReport, a report can be bound to a single DataSource at a time.

    If you want to have multiple grids with different data tables, then you can use SubReports in FlexReport. You can create FlexReports for each grid and then add them to the main FlexReport as subreports.

    For more information on subreports please refer to Subreport Field in docs.

    Also, see the attached sample SubReports.zip FlexReport

    SubReports.zip

    Regards,

    Uttkarsh.

Need extra support?

Upgrade your support plan and get personal unlimited phone support with our customer engagement team

Learn More

Forum Channels