Pass a dataset to report in ActiveReports 10

Posted by: luca on 19 January 2023, 10:02 pm EST

    • Post Options:
    • Link

    Posted 19 January 2023, 10:02 pm EST - Updated 19 January 2023, 10:44 pm EST

    I use this code to set datasource in report Load

      Private Sub _Report1_Load(sender As Object, e As EventArgs) Handles Me.Load
            Dim rpt As GrapeCity.ActiveReports.SectionReport = New GrapeCity.ActiveReports.SectionReport()
            Dim xtr As System.Xml.XmlTextReader = New System.Xml.XmlTextReader(Server.MapPath("~\Reports\Rpt_Offerta_PND.rpx"))
            rpt.LoadLayout(xtr)
            xtr.Close()
    
            rpt.DataSource = Session("MYDATASET").Tables("MYTABLE")
            WebViewer1.Report = rpt

    i’d like pass also MYDATASET in rpt so in the script i can use it.

    Can i do it ?

  • Posted 19 January 2023, 11:11 pm EST

    i resolved with :

    rpt.AddNamedItem(“Mydataset”, Session(“DSDATI”))

    and in the script of my report in START i convert the object to dataset

    _ds = CType(mydataset, dataset)

  • Posted 22 January 2023, 8:00 pm EST

    Hi Luca,

    We’re glad you were able to resolve this issue! Thanks for sharing the solution with us, this will help others facing a similar issue.

    Regards,

    Anand

Need extra support?

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

Learn More

Forum Channels