Active Reports 13 - report stream to client viewer

Posted by: sandro.puhmeister on 8 August 2019, 5:11 am EST

    • Post Options:
    • Link

    Posted 8 August 2019, 5:11 am EST

    Hi,

    We have recentely downloaded the trial version of ActiveReports 13 and we are testing it intensively. We are trying to reimplement/port functionalities from our old ActiveReports server/client applications to our new implementations. Our server based reporting applications are written in C# with .NET 4.7.2.

    We are trying to send generated result sreams from our server based application to our client application. Our client application uses the ActiveReports viewer to load/show report results directly (no processing and datasource calls on the client side).

    New reporting tools need to implement same functionalities as our old tools did. This means, save a report result as a stream and open it on the client side. Our old ActiveReports viewer was unable to open exported files (with extensions) directly, but was able to open streamed content.

    Our old implementations of ActiveReports server/client side applications implement four base steps:

    main_rpt = new ActiveReport3();
    

    We declare and load a .rpx report file into an ActiveReports AtiveReport3 class.

    main_rpt.Run();
    

    We run the report processing procedure to obtain the result stream.

    main_rpt.Document.Save(stream, RdfFormat.ARNet);
    

    Than we save the result into a MemoryStream which stays open and we send it to our client application.

    rpt.Document.Load(stream);
    

    Our client application receives the result through a web service and is able to load the stream back into a report object that gets rendered into ActiveReports viewer on the client side.

    We need some guidance on where to find the “save as stream” implementation if such implemnetation still exists in the latest ActiveReports.

    Looking forward to hearing from you soon.

    Thank you.

    Best regards.

    Sandro

  • Posted 9 August 2019, 1:57 am EST

    Hello,

    In ActiveReports 13, you can follow the four steps (including “save as stream” option) as follows:

    As it appears that you are using a SectionReport-

    //Creating an instance of an already created code-based SectionReport file
    SectionReport1 rpt = new SectionReport1();
    rpt.Run();
    MemoryStream str = new MemoryStream();
    rpt.Document.Save(str, GrapeCity.ActiveReports.Document.Section.RdfFormat.ARNet);
    

    Related documentation links:

    https://help.grapecity.com/activereports/webhelp/AR13/webframe.html#SaveandLoadReportLayoutFilesRPX.html

    https://help.grapecity.com/activereports/webhelp/AR13/webframe.html#SaveandLoadReportFilesRDF.html

    https://help.grapecity.com/activereports/webhelp/AR13/webframe.html#GrapeCity.ActiveReports~GrapeCity.ActiveReports.SectionReport~Document.html

    To load from a stream:

    str.Position = 0;
    rpt.Document.Load(f);
    //To view the report in viewer
    Viewer1.LoadDocument(f, GrapeCity.Viewer.Common.DocumentFormat.Rdf);
    

    Related documentation link: https://help.grapecity.com/activereports/webhelp/AR13/webframe.html#GrapeCity.ActiveReports.Document~GrapeCity.ActiveReports.Document.SectionDocument~Load.html

    Let me know if you need further assistance.

    Regards,

    Esha

  • Posted 9 August 2019, 3:55 am EST

    Hello Esha,

    Thank you for the reply. This is excatly what I was looking for. Indeed we are using section reports. This works perfect.

    Thank you again.

    Best regards,

    Sandro

Need extra support?

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

Learn More

Forum Channels