How to use existing rpx file which is having some scripts in ActiveReprts 13

Posted by: trisha.b.sinha on 2 October 2019, 5:38 pm EST

    • Post Options:
    • Link

    Posted 2 October 2019, 5:38 pm EST

    We are rewriting our code from activeReports2 to activeReports 13, there we have some existing rpx file. we are trying to call those file dynamically in a cs file but some of the exsiting rpx is having their own scripts which is written in vb like below,

    Sub OnReportStart()

    Dim srpt

    Set srpt = CreateObject("DDActiveReports2.ActiveReport")
    srpt.Load "abc.rpx"
    Set rpt.abc.Object = srpt
    Set srpt = Nothing
    
    Set srpt = CreateObject("DDActiveReports2.ActiveReport")
    srpt.Load "xyz.rpx"
    Set rpt.xyz.Object = srpt
    Set srpt = Nothing
    

    End Sub

    Sub OnReportEnd()

    Set rpt.abc.Object = Nothing
    Set rpt.xyz.Object = Nothing
    

    End Sub

    So how can we use those rpx file in our code.

  • Posted 2 October 2019, 6:24 pm EST

    Hello,

    I am assuming that your reports have code to load the subreport in the control. You need to rewrite the code for the script report as follow:

    
    Sub ActiveReport_ReportStart
    	Dim sbpt As new GrapeCity.ActiveReports.SectionReport()
    	sbpt.LoadLayout("rpt_Test.rpx")
    	me.SubReport1.Report=sbpt
    End Sub
    
    Sub ActiveReport_ReportEnd
    	me.SubReport1.Report=Nothing
    End Sub
    
    

    Hope it helps.

    Thanks,

    Mohit

Need extra support?

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

Learn More

Forum Channels