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)
Pls add the code snippet that configures the PDFReporter.
Need to know if there is a missing call to the method
withSubreportsor if the implementation is buggy so that only the first declared subreport is processed or if the reportname referencing is invalid. Perhaps the call towithSubreportsis only required in special szenarios wheras in normal flow just all reports in the report folder are treated as subreports except the reportname passedwithJrxml.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";
}
By the way: the code could be simplified by adding
/<...>/03731150-529D-47CC-8F31-D3467170B36CaswithResourceFolders:_reporterConfiguration.resourceFolderssee API doc
Last edit: Donat Mueller 2016-10-17
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
After changing the query in report_pageHeader to
..._c_s_sales_order.last_changed as "lastChanged"...and use 00BBA40D90C843E4BBC756CE60CD81CE as objectIdThe report_companyLogo is processed.
The
some test textfrom companyLogo is not displayed (report has an empty queryString expression). See attachment.Last edit: Donat Mueller 2016-12-20
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?