Create and run a report from a DataTable created programmatically

Posted by: BenAndMarsha on 7 May 2018, 12:25 pm EST

    • Post Options:
    • Link

    Posted 7 May 2018, 12:25 pm EST

    I would like to create a report and then run it using a Data Table I create programmatically as follows:

        Dim dsVisits As New DataSet
        Dim dtVisits As DataTable = New DataTable("Visits")
        dtVisits.Columns.Add("WeekNumber", Type.GetType("System.Int32"))
    .
    .
    .
    dtVisits.Rows.Add(drVisits)
    

    In your report designer, how do I tell it about this dataset that doesn’t yet exist?

    Then, to run it, how do I point your report writer to this dataset to run the report?

    Thanks.

    HBH

  • Posted 8 May 2018, 1:41 am EST

    Since you’re creating the DataSet at runtime, you will need to set the datasource of the report at runtime as well. The method differs for Page/RDL and SectionReports. Kindly refer to the following documentation links for detailed steps:

    For Page/RDL report - http://help.grapecity.com/activereports/webhelp/AR12/webframe.html#BindPageReportstoaData%20Source.html (Refer to the topic ‘To connect to an unbound Data Source’)

    For SectionReports - http://help.grapecity.com/activereports/webhelp/AR12/webframe.html#Modify%20Data%20Sources%20at%20Run%20Time.html

    You could also refer to the demo samples installed with the product at the following locations:

    \Documents\GrapeCity Samples\ActiveReports 12\Page Reports And RDL Reports\Data\JsonDataSource

    \Documents\GrapeCity Samples\ActiveReports 12\Section Reports\Data\BoundData

Need extra support?

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

Learn More

Forum Channels