Active Reports 13.1 Set Parameters at Runtime

Posted by: rwatts on 8 July 2019, 5:15 am EST

    • Post Options:
    • Link

    Posted 8 July 2019, 5:15 am EST

    Hello,

    We recently upgraded from Active Reports 10 to Active Reports 13.1. I noticed one of our reports was taking a lot longer to complete after the update (from a couple of seconds to now taking 20-30 or longer). In this particular report, I am setting some report parameters in our program at runtime. I have found that each time I access the Parameters object, the stored procedure that is in the report is being called. The problem is, all parameters are blank or null at this time so the procedure ends up returning a large data set. Is there anyway to prevent the procedure from being executed? I just want to access the parameters in the report file and set the values so when the report runs the parameters will be set. I don’t believe this occurred in ActiveReports 10 otherwise the report would have been slow in that release. Below is a sample of what I’m doing. I load the file definition, create the PageDocument object, and set parameters. Each time the runTime.Parameters is hit, the stored procedure executes. Even when the ‘runtime.Parameters.Contains’ is hit, the procedure is exectued. Any assistance would be greatly appreciated.

    GrapeCity.ActiveReports.PageReport def = new GrapeCity.ActiveReports.PageReport(new System.IO.FileInfo(filePath);

    GrapeCity.ActiveReports.Document.PageDocument runTime = new GrapeCity.ActiveReports.Document.PageDocument(def);

    if (runTime.Parameters.Contains(“StartValue”))

    runTime.Parameters[“StartValue”].CurrentValue = “XXX”;

    Thanks!

    Richard

  • Posted 8 July 2019, 7:37 pm EST

    Hello Richard,

    I used the same sample code and could set the parameter value at runtime without any issues.

    Please refer the attached application showing the same. The report in the application is bound to Reels.mdb shipped with ActiveReports.

    Use the same to modify your application and in case the issue persists, modify it and share so that I can obsevre the issue as well. This will help me assist you further.

    Regards,

    Esha

    prj_PageReportApplication_Parameters.zip

Need extra support?

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

Learn More

Forum Channels