Jump to content
We've recently updated our Privacy Statement, available here ×

meatjasperforge

Members
  • Posts

    3
  • Joined

  • Last visited

meatjasperforge's Achievements

Rookie

Rookie (2/14)

  • Week One Done
  • One Month Later
  • One Year In
  • First Post Rare
  • Conversation Starter Rare

Recent Badges

0

Reputation

  1. Hi, JasperReports 3.7.1 prints white pages in my report (create with iReport) if i don't feed it with datasource but only with an hashmap for parameters.
  2. Hi everyone. I have the necessity to fill a master report with a list of subreports. The subreport schema is the same for every repetition. The subreport's data is loaded from an XML datasource. The subreport contains parameters. The subreport's repetition involves in an horizontal way and each master report's page contains two subreports. I could fix the subreport twice in the master report, on the left and on the right for example. This way I'll have two subreport with the same params' name! How can I pass the params' value to the subreports, showing different data value, if the they have params with the same name? I've tried to use a FIELD classed to net.sf.jasperreports.engine.JasperReport but it's forbidden. So....any solution? Thanks
  3. Hi everyone, I know this post represents yet another post on subreports' datasource, but I can't find anywhere a working solution! This is the XML I want to use for datasource.<reports> <report id="R"> <X>..</X> ... </report> <report id="S"> <Y>..</Y> ... </report></reports> Through XPath /reports/report[@id=R]/X and /reports/report[@id=R]/Y I can manage to select the data from the above xml.So far so good. Given the subreport S, I declare at the top of the jrxml <field name="data" class="java.lang.String"> <fieldDescription><![CDATA[data]]></fieldDescription></field> <parameter name="mySubreport" class="net.sf.jasperreports.engine.JasperReport"/> and I use the field $F{data} in the DETAIL section. Given the report R, I declare at the top of the jrxml <field name="data" class="java.lang.String"> <fieldDescription><![CDATA[data]]></fieldDescription></field> and I use the SUBREPORT tag in the SUMMARY section <subreport> <reportElement ..../> <subreportParameter name="data"> <subreportParameterExpression><![CDATA[$F{data}]]></subreportParameterExpression> </subreportParameter> <dataSourceExpression><![CDATA[new net.sf.jasperreports.engine.JREmptyDataSource()]]></dataSourceExpression> <subreportExpression class="net.sf.jasperreports.engine.JasperReport"><![CDATA[$P{mySubreport}]]></subreportExpression></subreport> The Java code I'm trying to develop is JRXmlDataSource jrDS_sub = new JRXmlDataSource(xmlDom, " /reports/report[@id=S]/Y");JasperDesign subJD = JRXmlLoader.load(designPath + sub_03Design);JasperReport subJR = JasperCompileManager.compileReport(subJD);JasperPrint subJP = JasperFillManager.fillReport(subJR, null, jrDS_sub); JRXmlDataSource jrDS_report = new JRXmlDataSource(xmlDom, " /reports/report[@id=S]/Y");JasperDesign reportJD = JRXmlLoader.load(designPath + reportDesign);JasperReport reportJR = JasperCompileManager.compileReport(reportJD); // BUT....subJR is a JasperReport class type, where the report is not filled yet. I should insert a JasperPrint class type, where// the data has been filled!params.put("mySubreport", subJR);JasperPrint reportJP = JasperFillManager.fillReport(reportJR, null, jrDS_report); JasperExportManager.exportReportToPdfFile(reportJP, ".."); And now? Thanks in advance The result is
×
×
  • Create New...