Menu

#75 Subreports used by other subreports are not working

2.0.0
open
nobody
None
2016-12-21
2016-10-17
Bogdan Pop
No

Scenario: A main report uses subreport #1. Subreport #1 uses subreport #2.
Expected: subreport #2 is correctly displayed.
Actual: subreport #2 is not displayed.

I attached the report and the database used for founding this issue. The reports hierarchy looks like this:
report.jrxml
-> report_pageHeader.jrxml
-> report_companyLogo.jrxml (this one is not displayed)

2 Attachments

Discussion

  • Donat Mueller

    Donat Mueller - 2016-10-17

    Pls add the code snippet that configures the PDFReporter.
    Need to know if there is a missing call to the method withSubreports or if the implementation is buggy so that only the first declared subreport is processed or if the reportname referencing is invalid. Perhaps the call to withSubreports is only required in special szenarios wheras in normal flow just all reports in the report folder are treated as subreports except the reportname passed withJrxml.

     
  • Bogdan Pop

    Bogdan Pop - 2016-10-17

    The call is:

    [ReportExporter exportReportToPdf:outputPath withJrxml:reportSourcePath withResourceFolders:@[reportFolder, pathToAccountsDirectory,resourcePath] andSqlite3:dataBasePath withParameters:params withSubreports:subReportsDict];

    where:
    reportSourcePath = /<...>/03731150-529D-47CC-8F31-D3467170B36C/report.jrxml

    and

    subReportsDict =
    {
    "reportaddress" = "/<...>/03731150-529D-47CC-8F31-D3467170B36C/reportaddress.jrxml";
    "reportaddress1" = "/<...>/03731150-529D-47CC-8F31-D3467170B36C/reportaddress1.jrxml";
    "reportcompanyLogo" = "/<...>/03731150-529D-47CC-8F31-D3467170B36C/reportcompanyLogo.jrxml";
    "reportcompanyName" = "/<...>/03731150-529D-47CC-8F31-D3467170B36C/reportcompanyName.jrxml";
    "reportitem" = "/<...>/03731150-529D-47CC-8F31-D3467170B36C/reportitem.jrxml";
    "reportitems" = "/<...>/03731150-529D-47CC-8F31-D3467170B36C/reportitems.jrxml";
    "reportpageFooter" = "/<...>/03731150-529D-47CC-8F31-D3467170B36C/reportpageFooter.jrxml";
    "reportpageHeader" = "/<...>/03731150-529D-47CC-8F31-D3467170B36C/reportpageHeader.jrxml";
    }

     
  • Donat Mueller

    Donat Mueller - 2016-10-17

    By the way: the code could be simplified by adding /<...>/03731150-529D-47CC-8F31-D3467170B36C as withResourceFolders:_reporterConfiguration.resourceFolders
    see API doc

     

    Last edit: Donat Mueller 2016-10-17
  • Donat Mueller

    Donat Mueller - 2016-12-20

    Ttried the report on desktop. Report was generated as sales.pdf as expected. Both
    report_pageHeader and report_pageFooter are processed. But the subreport elements are blank so I guess the problem is the data.
    WIthout a small sample that shows the issue its somehow difficult. We have complex subreport samples that work

     
  • Donat Mueller

    Donat Mueller - 2016-12-20

    After changing the query in report_pageHeader to ..._c_s_sales_order.last_changed as "lastChanged"... and use 00BBA40D90C843E4BBC756CE60CD81CE as objectId
    The report_companyLogo is processed.
    The some test text from companyLogo is not displayed (report has an empty queryString expression). See attachment.

     

    Last edit: Donat Mueller 2016-12-20
  • Bogdan Pop

    Bogdan Pop - 2016-12-21

    So the probelm is that the query is empty in the 'report_companyLogo'. Can you tell me how the subreport should look like if I want 'some test text' to be displayed? Should I remove completely the 'queryString' tag?

     

Log in to post a comment.

MongoDB Logo MongoDB