Merging Multiple FlexReports

Posted by: paul on 3 April 2018, 11:06 pm EST

    • Post Options:
    • Link

    Posted 3 April 2018, 11:06 pm EST

    I have several Flex Reports that I need to be able to preview in the FlexViewer control or print as a single report with the correct page numbers.

    Is there any way I can do this?

  • Posted 4 April 2018, 5:26 pm EST

    Hello,

    You can make use of Subreports to merge multiple FlexReports in one. You can do that by inserting a FlexReport in to the other as a subreport such that the second FlexReport will get rendered after finishing the first FlexReport. When using this way, all the FlexReports are linked to each other and are rendered at a time and thus, can be viewed in the C1FlexViewer. Note that a report’s PageHeader and PageFooter are not rendered when it is used as a subreport in a main report. A report file has been attached for your reference.

    Please elaborate on correct page numbers so that we can assist you further.

    Best Regards,

    Esha

    MergeReports.flxr.zip

  • Posted 4 April 2018, 7:38 pm EST

    Thanks for your reply Esha, I will take a look when I get time.

    Regarding the pages numbers, if I have 3 reports each with 10 pages I need the main footer page count to show 1 of 30 through to 30 of 30. I suspect that the subreport approach will do this.

  • Posted 5 April 2018, 1:44 am EST

    Is there any way to merge reports while rendering all pageheaders and pagefooters? We used to merge C1Reports by using a PrintDocument but this doesn’t seem to be available in FlexReports

  • Posted 9 April 2018, 4:03 pm EST

    Hello,

    Apologies for the delay. In order to achieve the desired layout, you can obtain the images for each report’s pages using the GetPageImage method: http://help.grapecity.com/componentone/NetHelp/FlexReport/webframe.html#C1.Win.FlexReport.4~C1.Win.FlexReport.C1FlexReport~GetPageImage.html

    These images are added to a new report using the ImageField.

    In this way, the multiple reports can fall under a single report and the page numbers can also be shown in the PageFooter. A sample has been attached for your reference.

    Also, please note that C1FlexReport does not have C1PrintDocument and C1MultiDocument related features. This is a limitation.

    Best Regards,

    Esha

    prj_MultipleFlexReports.zip

  • Posted 12 April 2018, 8:11 pm EST

    Hello,

    Another way of merging FlexReports is using subsections. A sample showing the same has been attached for your reference.

    Best Regards,

    Esha

    MergeFlexReport.zip

  • Posted 25 June 2020, 10:01 am EST

    Is it possible to merge two reports having different layout? I have a first report with Landscape and the second one is Portrait.

    There is no way to just insert the pages? Because this technique of getting the image and add it into the Detail subsection I dont like it. Would be best if you can just take the pages from one report and append to a second one in order to view it in the FlexReportViewer.

    Any clue?

  • Posted 25 June 2020, 12:43 pm EST

    Esha I have a problem with GetPageImage, Im attaching a zip with the same project you post in the answer but i change the reports to use mines. These reports are working perfect since long time ago on the Winforms app with FlexViewer, but when I tried to use your code to merge them then the resolution seems to be bad, my reports doesnt fit in the merge report.

    I have been trying to fix this but is breaking my head. Why is this?MergeFlexReport_Resolutionproblem.zip

  • Posted 25 June 2020, 11:13 pm EST - Updated 3 October 2022, 2:48 pm EST

    Hi Alejandro,

    >>Is it possible to merge two reports having different layout? I have the first report with Landscape and the second one is Portrait.

    Sorry but FlexReport does not support mix orientation means you can not show LandScape subreport in a Portrait report.

    >>when I tried to use your code to merge them then the resolution seems to be bad, my reports doesn’t fit in the merge report.

    Sorry, but we can not reproduce the issue at our end as shown in the attached GIF. If you are getting any different result then please let us know and if there is any other understanding then please explain in brief.

    Regards,

    Prabhat Sharma.

Need extra support?

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

Learn More

Forum Channels