Embed Subreports into main Report?

Posted by: madrianr on 4 August 2017, 3:09 pm EST

  • Posted 4 August 2017, 3:09 pm EST

    Hello,


    Isn't it possible to embed the subreports into the main report and save it to a xml (rpx) file?


    Now we have to save seperate files in a database


     


    regards

  • Replied 4 August 2017, 3:09 pm EST

    Thank you for your reply. Unfortunately, ActiveReports does not offer the ability to contain 2 reports (main and sub) in the same RPX file as the RPX file is simply a report layout file. Also, you can find some additional information about RPX files here:

    http://www.datadynamics.com/Help/AR2Std/HX_Using_RPX_Files.html

    Thanks,
        Eric

  • Replied 4 August 2017, 3:09 pm EST

    Yes, Nick is correct, you cannot do that directly by just saving an RPX file with a SubReport. However, a possible workaround would be to save the report layout (which would be displayed in the SubReport control on the main report) using a serialization technique and store a string in the main report's script code. At runtime, the data could then be deserialized and loaded back into a report object, which could then be assigned to a SubReport control.

    However, if you are simply building reports are design time, I do not recommend this because it would be far more additional work than just saving RPX files. It would also make debugging very difficult. Nevertheless, it may be possible to automate this process if building an EndUserDesigner application. However, if you're just storing layouts in a database or flat files, it may still be simpler to just add some extra columns to a table or otherwise designate a layout to be associated with a particular SubReport control on another saved layout.

    Tim
  • Replied 4 August 2017, 3:09 pm EST

    the rpx file is a xml file - wouldn't it be a good feature to design the xml structure that subreports are saved within one


    rpx file?


    regards


     

  • Replied 4 August 2017, 3:09 pm EST

    madrianr,

    The reason why this is not supported is because a subreport is merely just a control on the report. Each report, whether it be a standalone report, or a report which runs inside another report, is technically a separate report. Reports design to be used within a subreport control can still be ran individually, although they may require parameters and/or need to have a data source passed to them.

    If you have any more questions, feel free to ask.

    Thanks,
    Jon
  • Replied 4 August 2017, 3:09 pm EST

    I know that a sibreport is a seperate report but the question is not the change this design but only
    make a "designer" availible where it would be possible to design the subreport (datasource, link between main report and
    subreport ....) after double klick on the subreport control (see MS Access) and save it as a single xml file.


    regards

  • Replied 4 August 2017, 3:09 pm EST

    is this possible in the NET versions?


     


    regards

  • Replied 4 August 2017, 3:09 pm EST

    Madrianr,
    Unfortunately, this is not possible in the .NET versions either as the RPX file is a simple report layout.


  • Replied 4 August 2017, 3:09 pm EST

    Thank you for your reply. It is possible to provide a ‘link’ between the subreport and main report as described though the use of scripting. Using this approach you will still need to design each report separately, however you can perform actions such as data connections and setting subreports for main reports through script. Also, please note the RPX file contains both the layout and script for the report.

    You can find some additional information about scripting here:

    http://www.datadynamics.com/Help/AR2Std/HX_Chapter_14_Scripting_and_XML.html

    Thanks,
        Eric

Need extra support?

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

Learn More

Forum Channels