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

benoitx

Members
  • Posts

    27
  • Joined

  • Last visited

benoitx's Achievements

Explorer

Explorer (4/14)

  • Week One Done
  • One Month Later
  • One Year In
  • First Post Rare
  • Collaborator Rare

Recent Badges

0

Reputation

  1. Dear All, I was wondering if anyone had tried to SIGN a PDF generated through JasperReports? By signing I mean using Security and Encryption for creating a HASH of the content. I know that iText seems to have a fair bit but I was wondering how it can be done via JasperReports? http://itextpdf.sourceforge.net/howtosign.html We are using JRPdfExporter at the moment. Many thanks Benoit
  2. Hum... I should have checked JRPdfExporterParameter.METADATA_TITLE and co before posting this.. Sorry! Will try it now... Benoit
  3. Hello We are exporting our JasperReport in PDF and I was wondering how it would be possible to set the following attributes that are visible through Acrobat Reader | Properties (see image pdf-export.PDF). More specifically: the Title, Author, Subject and Keywords We do the export as follows... How could pass these attributes to the exporter? Many thanks! Benoit Code:try { final JRPdfExporter exporter = new JRPdfExporter(); final File destFile = new File(fileName); exporter.setParameter(JRExporterParameter.JASPER_PRINT, report); exporter.setParameter(JRExporterParameter.OUTPUT_FILE, destFile); exporter.setParameter(JRPdfExporterParameter.IS_ENCRYPTED, Boolean.TRUE); exporter.setParameter(JRPdfExporterParameter.IS_128_BIT_KEY, Boolean.TRUE); exporter.setParameter(JRPdfExporterParameter.PERMISSIONS, new Integer(PdfWriter.ALLOW_COPY | PdfWriter.ALLOW_PRINTING)); exporter.exportReport();...
  4. Hi Have a look at this post http://jasperforge.org/plugins/espforum/view.php?group_id=102&forumid=103&topicid=50889 It was specific to the issue of empty sub reports with XML datasource and we found a solution... eventually! Good luck Regards Benoit
  5. Hi All, First of all, thanks a lot for helping. We have found a way around... It seems that the issue is related to the way we call Jasper to fill the report. It is rather confusing that the Master report was filled ok but not the sub reports. We used to call: JasperReport reportTemplate = .... final String xml = generateXml(); // our method JRDataSource ds = new JRXmlDataSource(new ByteArrayInputStream(xml.getBytes())); JasperReport report = JasperFillManager.fillReport(reportTemplate, new HashMap(), ds); And that works ok for the master report... it implies that Jasper itself needs to do the parsing of the XML string. I have changed this to creating the XML document and giving it to jasper: JasperReport reportTemplate = .... final String xml = generateXml(); // our method Document document = JRXmlUtils.parse(new ByteArrayInputStream(xml.getBytes())); Map params = new HashMap(); params.put(JRXPathQueryExecuterFactory.PARAMETER_XML_DATA_DOCUMENT, document); params.put(JRXPathQueryExecuterFactory.XML_DATE_PATTERN, "yyyy-MM-dd"); params.put(JRXPathQueryExecuterFactory.XML_NUMBER_PATTERN, "#,##0.##"); params.put(JRXPathQueryExecuterFactory.XML_LOCALE, Locale.ENGLISH); JasperReport report = JasperFillManager.fillReport(reportTemplate, params); And this is working... I have no idea why... any explanation would be welcome! The 50 USD offer is cancelled, sorry... Best regards from a rainy London! Benoit
  6. QUICK UPDATE ------------------------- Ignore previous post, JBoss had a 'spare' jaxen library (1.1-beta9) in its server/default/lib library. I have removed it and added a jasperreports.properties in my ear file which initially failed as expected as I had not included the jaxen-1.1.1.jar. Once I added the jaxen jar, it ran the report ok, it seems to be faster... BUT... the subreports are still empty.... I must have done something wrong with the dataSource, Teodor, could you have a look (in the original forum.zip) and tell me my stupid mistake... Also, how could we force iReport to use Jaxen? Thanks a lot! Benoit
  7. That sound like a good plan but... 1/ is there a way to force iReport to use jaxen too? I have added the jasperreports.properties file (enclosed) in the top package of my jar which is in a jar inside the ear... 2/ Does it log where it is loading that properties file? All I get is the following log and I have the suspicion that it is not using jaxen... the PDF is the same... It does show where the extension is loaded but not the jasperreports properties. To prove my point, I have removed jaxen from the ear file and left the jasperreports.properties, assuming that it'd throw an exception when trying to get a Jaxen class... nope! So I'm having problem to ensure using that jasperreports.properties... Thanks! Benoit Code:2009-01-21 17:57:09,083 DEBUG [extensions.ExtensionsEnvironment#correspondenceMDPListenerContainer-1] Instantiating extensions registry class net.sf.jasperreports.extensions.DefaultExtensionsRegistry2009-01-21 17:57:09,083 DEBUG [extensions.DefaultExtensionsRegistry#correspondenceMDPListenerContainer-1] Loading JasperReports extension properties resource jar:file:/C:/java/jboss-4.0.5.GA/server/default/tmp/deploy/tmp36451appendium-ear-1.0.ear-contents/appendium-ejb-1.0.jar-contents/jasperreports-3.1.3.jar!/jasperreports_extension.properties2009-01-21 17:57:09,099 DEBUG [extensions.DefaultExtensionsRegistry#correspondenceMDPListenerContainer-1] Instantiating extensions registry for default using factory class net.sf.jasperreports.extensions.DefaultExtensionsRegistryFactory2009-01-21 17:57:09,708 DEBUG [fill.JRBaseFiller#correspondenceMDPListenerContainer-1] Fill 31120972: created for billing-confirm2009-01-21 17:57:10,067 DEBUG [fill.JRBaseFiller#correspondenceMDPListenerContainer-1] Fill 31120972: filling report2009-01-21 17:57:10,161 DEBUG [fill.JRBaseFiller#correspondenceMDPListenerContainer-1] Fill 31120972: adding page 12009-01-21 17:57:10,161 DEBUG [fill.JRVerticalFiller#correspondenceMDPListenerContainer-1] Fill 31120972: title2009-01-21 17:57:10,364 DEBUG [fill.JRVerticalFiller#correspondenceMDPListenerContainer-1] Fill 31120972: page header2009-01-21 17:57:10,395 DEBUG [fill.JRVerticalFiller#correspondenceMDPListenerContainer-1] Fill 31120972: column header2009-01-21 17:57:10,395 DEBUG [fill.JRVerticalFiller#correspondenceMDPListenerContainer-1] Fill 31120972: detail2009-01-21 17:57:10,442 DEBUG [fill.JRFillSubreport#correspondenceMDPListenerContainer-1] Fill 31120972: creating subreport filler2009-01-21 17:57:10,442 DEBUG [fill.JRBaseFiller#correspondenceMDPListenerContainer-1] Fill 10575295: created for billing-per-txn2009-01-21 17:57:10,474 DEBUG [fill.JRFillSubreport#correspondenceMDPListenerContainer-1] Fill 31120972: starting 105752952009-01-21 17:57:10,474 DEBUG [fill.JRThreadSubreportRunner#correspondenceMDPListenerContainer-1] Fill 10575295: starting thread Thread[billing-per-txn subreport filler,5,jboss]2009-01-21 17:57:10,474 DEBUG [fill.JRThreadSubreportRunner#correspondenceMDPListenerContainer-1] Fill 10575295: waiting for fill result2009-01-21 17:57:10,474 DEBUG [fill.JRBaseFiller#billing-per-txn subreport filler] Fill 10575295: filling report2009-01-21 17:57:10,474 DEBUG [fill.JRVerticalFiller#billing-per-txn subreport filler] Fill 10575295: no data2009-01-21 17:57:10,474 DEBUG [fill.JRVerticalFiller#billing-per-txn subreport filler] Fill 10575295: all sections2009-01-21 17:57:10,474 DEBUG [fill.JRVerticalFiller#billing-per-txn subreport filler] Fill 10575295: noData2009-01-21 17:57:10,489 DEBUG [fill.JRBaseFiller#billing-per-txn subreport filler] Fill 10575295: ended2009-01-21 17:57:10,489 DEBUG [fill.JRThreadSubreportRunner#billing-per-txn subreport filler] Fill 10575295: notifying of completion2009-01-21 17:57:10,489 DEBUG [fill.JRThreadSubreportRunner#correspondenceMDPListenerContainer-1] Fill 10575295: notified of fill result2009-01-21 17:57:10,489 DEBUG [fill.JRFillSubreport#correspondenceMDPListenerContainer-1] Fill 31120972: subreport 10575295 finished2009-01-21 17:57:10,505 DEBUG [fill.JRVerticalFiller#correspondenceMDPListenerContainer-1] Fill 31120972: summary2009-01-21 17:57:10,505 DEBUG [fill.JRVerticalFiller#correspondenceMDPListenerContainer-1] Fill 31120972: column footer2009-01-21 17:57:10,505 DEBUG [fill.JRVerticalFiller#correspondenceMDPListenerContainer-1] Fill 31120972: last page footer2009-01-21 17:57:10,505 DEBUG [fill.JRBaseFiller#correspondenceMDPListenerContainer-1] Fill 31120972: ended
  8. Thanks Teodor, I will try now. Do I *have* to use a jasperreports.properties file or is there a way to set it pro grammatically? Thanks Benoit
  9. I can't put the iReport xalan.jar, xml-apis.jar and xercesImpl.jar in the JBoss/lib/endorsed (JBoss 4.0.5) as it will not start JBoss. Any suggestion? Is there some login we could add to detect more on the xpath issue? I'm willing to run a 'debug' version of JasperReport to get to the bottom of this... I have also replaced JasperReports-3.0.0.jar in iReport/lib with 3.1.3; it still works under iReport but not with JBoss... ...Help...
  10. Hi Teodor, I noticed that problem just AFTER posting the reply... typical. Yes, it now shows the noDataSection (see attached). So, we have now proved that the sub report is called but that the dataSource is empty. This seems to point to XALAN issue... so: 1/ is it only xalan.jar ? or should I also try with xml-apis.jar and xercesImpl.jar? What about xml-apis-ext.jar? it is in iReport/lib but not Jboss 2/ if I replace the iReport/lib with the versions from Jboss, the report still works... why? 3/ How could I force my JAR inside my EAR only to use a specific version of xalan? So many questions.. so little time... Any suggestions? Thanks Benoit
  11. Hi Teodor, Thanks for your reply. I have now added a noData section (see below) in my FIRST sub report. This does not seem to have made any difference... Where should it be put? staright after </summary>? This does not seem to have generated anything by the compiler (I enclose the java code generated).. Is this a new feature? Does the JasperReports 3.1.3 compile this? Is there a way to figure out / print which compiler is used? I've started to investigate the Xalan suggestion and it seems that iReport may be using Xalan 2.6 whislt JBoss/lib/endorsed is using Xalan 2.7. I then put the JBOSS versions of xalan.jar, xercesImpl.jar, xml-apis.jar in iReport-3.0.0/lib assuming that it should now fail to run the report... but no, the report is ok... I have also put the xalan.jar in my JAR file (inside the EAR) and inside the ejb.manifest.classpath... no change! It is getting weirder by the minute... I must be doing something very very stupid... Your help is appreciated Thanks Benoit Code: <noData> <band height="150" isSplitAllowed="true" > <ellipse> <reportElement x="134" y="9" width="276" height="31" key="ellipse-1"/> <graphicElement stretchType="NoStretch"/> </ellipse> <staticText> <reportElement x="198" y="14" width="172" height="16" key="staticText-1"/> <box></box> <textElement> <font/> </textElement> <text><![CDATA[NOTHING TO SHOW, GO AWAY...]]></text> </staticText> </band> </noData>
  12. Dear C-Box, Thanks for your input. I should have said that we did change the iReport build directory to match the package structure, com/appendium/pf/server/jasper I really do not think that the issue is related to not finding the subreport as we used to get exceptions on this matter (see other thread under 'subreport in a JAR' subject). This was fixed thanks to a few suggestions. Your post however made me realise that although the JRXML files are IDENTICAL in both situation, the iReport does compile the files to java and then Jasper and so does our build process using Maven. I enclose the way we do the Maven Build... Unfortunately, we I do check if the java files are different, they are hardly so... certainly not in any way that would justify the issue I would think. I did put the .jasper files generated by iReport in our JAR directly but the issue is the same... I enclose 2 sets of java files, is there any issue between the files? We're using iReport 3.0.0 and JasperReports 3.1.3 This is really spooky issue... Thanks a lot Benoit Code:<goal name="compileJasperReports"> <taskdef name="jrc" classname="net.sf.jasperreports.ant.JRAntCompileTask"> <ant:classpath> <ant:path refid="maven.dependency.classpath" /> </ant:classpath> </taskdef> <ant:jrc srcdir="${basedir}/src/main/jasperreports" destdir="${maven.build.dest}" tempdir="${maven.build.dest}" keepjava="true" xmlvalidation="true"> <ant:classpath> <ant:path refid="maven.dependency.classpath" /> <ant:pathelement path="${maven.build.dest}" /> </ant:classpath> <ant:include name="**/*.jrxml" /> </ant:jrc></goal>
  13. Hi Teodor, Thanks for pointing this to me, it will be useful but unfortunately at the moment, we're using windows XP 32bit for both iReport and JBoss. I have however changed all textfields as follow: <textField isStretchWithOverflow="true" But it does not change the issue. See the log from JBoss, it keeps saying: Fill 27349545: no data Any suggestion? thanks Benoit Code:11:37:23,578 DEBUG [ExtensionsEnvironment][correspondenceMDPListenerContainer-1] Instantiating extensions registry class net.sf.jasperreports.extensions.DefaultExtensionsRegistry11:37:23,593 DEBUG [DefaultExtensionsRegistry][correspondenceMDPListenerContainer-1] Loading JasperReports extension properties resource jar:file:/C:/java/jboss-4.0.5.GA/server/default/tmp/deploy/tmp24292appendium-ear-1.0.ear-contents/appendium-ejb-1.0.jar-contents/jasperreports-3.1.3.jar!/jasperreports_extension.properties11:37:23,593 DEBUG [DefaultExtensionsRegistry][correspondenceMDPListenerContainer-1] Instantiating extensions registry for default using factory class net.sf.jasperreports.extensions.DefaultExtensionsRegistryFactory11:37:23,953 DEBUG [JRBaseFiller][correspondenceMDPListenerContainer-1] Fill 11439156: created for billing-confirm11:37:24,140 DEBUG [JRBaseFiller][correspondenceMDPListenerContainer-1] Fill 11439156: filling report11:37:24,187 DEBUG [JRBaseFiller][correspondenceMDPListenerContainer-1] Fill 11439156: adding page 111:37:24,187 DEBUG [JRVerticalFiller][correspondenceMDPListenerContainer-1] Fill 11439156: title11:37:24,312 DEBUG [JRVerticalFiller][correspondenceMDPListenerContainer-1] Fill 11439156: page header11:37:24,312 DEBUG [JRVerticalFiller][correspondenceMDPListenerContainer-1] Fill 11439156: column header11:37:24,312 DEBUG [JRVerticalFiller][correspondenceMDPListenerContainer-1] Fill 11439156: detail11:37:24,343 DEBUG [JRFillSubreport][correspondenceMDPListenerContainer-1] Fill 11439156: creating subreport filler11:37:24,343 DEBUG [JRBaseFiller][correspondenceMDPListenerContainer-1] Fill 27349545: created for billing-per-txn11:37:24,359 DEBUG [JRFillSubreport][correspondenceMDPListenerContainer-1] Fill 11439156: starting 2734954511:37:24,359 DEBUG [JRThreadSubreportRunner][correspondenceMDPListenerContainer-1] Fill 27349545: starting thread Thread[billing-per-txn subreport filler,5,jboss]11:37:24,359 DEBUG [JRBaseFiller][billing-per-txn subreport filler] Fill 27349545: filling report11:37:24,359 DEBUG [JRThreadSubreportRunner][correspondenceMDPListenerContainer-1] Fill 27349545: waiting for fill result11:37:24,359 DEBUG [JRVerticalFiller][billing-per-txn subreport filler] Fill 27349545: no data11:37:24,359 DEBUG [JRVerticalFiller][billing-per-txn subreport filler] Fill 27349545: no pages11:37:24,359 DEBUG [JRBaseFiller][billing-per-txn subreport filler] Fill 27349545: ended11:37:24,359 DEBUG [JRThreadSubreportRunner][billing-per-txn subreport filler] Fill 27349545: notifying of completion11:37:24,359 DEBUG [JRThreadSubreportRunner][correspondenceMDPListenerContainer-1] Fill 27349545: notified of fill result11:37:24,359 DEBUG [JRFillSubreport][correspondenceMDPListenerContainer-1] Fill 11439156: subreport 27349545 finished11:37:24,375 DEBUG [JRVerticalFiller][correspondenceMDPListenerContainer-1] Fill 11439156: summary11:37:24,375 DEBUG [JRVerticalFiller][correspondenceMDPListenerContainer-1] Fill 11439156: column footer11:37:24,375 DEBUG [JRVerticalFiller][correspondenceMDPListenerContainer-1] Fill 11439156: last page footer11:37:24,375 DEBUG [JRBaseFiller][correspondenceMDPListenerContainer-1] Fill 11439156: ended11:37:24,421 DEBUG [serverProperties][correspondenceMDPListenerContainer-1] using client-agnostic entry for property confirmations.outputDir
  14. Dear Blarsen, Thanks for your contribution. Unfortunately, it seems that the report does not compile when using your suggestion. [jrc] net.sf.jasperreports.engine.JRException: Errors were encountered when compiling report expressions class file: [jrc] C:projectsafemargin-protoservertargetclassesbilling45confirm_1232531302078_523922.java:259: inconvertible types [jrc] found : java.lang.String [jrc] required: net.sf.jasperreports.engine.JasperReport [jrc] value = (net.sf.jasperreports.engine.JasperReport)("com/appendium/pf/server/jasper/billing-per-txn.jasp er"); //$JR_EXPR_ID=19$ Should the expression be different that the CDATA[.... ? Regards Benoit Code:compileJasperReports: [jrc] Compiling 1 report design files. [jrc] File : C:projectsafemargin-protoserversrcmainjasperreportscomappendiumpfserverjasperbilling-confirm.jrxml ... FAILED. [jrc] Error compiling report design : C:projectsafemargin-protoserversrcmainjasperreportscomappendiumpfserverjasperbilling-confirm.jrxml [jrc] net.sf.jasperreports.engine.JRException: Errors were encountered when compiling report expressions class file: [jrc] C:projectsafemargin-protoservertargetclassesbilling45confirm_1232531302078_523922.java:259: inconvertible types [jrc] found : java.lang.String [jrc] required: net.sf.jasperreports.engine.JasperReport [jrc] value = (net.sf.jasperreports.engine.JasperReport)("com/appendium/pf/server/jasper/billing-per-txn.jasper"); //$JR_EXPR_ID=19$ [jrc] ^ [jrc] C:projectsafemargin-protoservertargetclassesbilling45confirm_1232531302078_523922.java:377: inconvertible types [jrc] found : java.lang.String [jrc] required: net.sf.jasperreports.engine.JasperReport [jrc] value = (net.sf.jasperreports.engine.JasperReport)("com/appendium/pf/server/jasper/billing-per-txn.jasper"); //$JR_EXPR_ID=19$ [jrc] ^ [jrc] C:projectsafemargin-protoservertargetclassesbilling45confirm_1232531302078_523922.java:495: inconvertible types [jrc] found : java.lang.String [jrc] required: net.sf.jasperreports.engine.JasperReport [jrc] value = (net.sf.jasperreports.engine.JasperReport)("com/appendium/pf/server/jasper/billing-per-txn.jasper"); //$JR_EXPR_ID=19$ [jrc] ^ [jrc] 3 errors [jrc] [jrc] at net.sf.jasperreports.engine.design.JRAbstractCompiler.compileReport(JRAbstractCompiler.java:195) [jrc] at net.sf.jasperreports.engine.JasperCompileManager.compileReport(JasperCompileManager.java:219) [jrc] at net.sf.jasperreports.engine.JasperCompileManager.compileReportToFile(JasperCompileManager.java:135) [jrc] at net.sf.jasperreports.engine.JasperCompileManager.compileReportToFile(JasperCompileManager.java:117) [jrc] at net.sf.jasperreports.ant.JRAntCompileTask.compile(JRAntCompileTask.java:413) [jrc] at net.sf.jasperreports.ant.JRAntCompileTask.execute(JRAntCompileTask.java:259) [jrc] at org.apache.tools.ant.Task.perform(Task.java:364) [jrc] at org.apache.commons.jelly.tags.ant.AntTag.doTag(AntTag.java:195) [jrc] at org.apache.commons.jelly.impl.TagScript.run(TagScript.java:250) [jrc] at org.apache.commons.jelly.impl.ScriptBlock.run(ScriptBlock.java:95) [jrc] at org.apache.maven.jelly.tags.werkz.MavenGoalTag.runBodyTag(MavenGoalTag.java:83) [jrc] at org.apache.maven.jelly.tags.werkz.MavenGoalTag$MavenGoalAction.performAction(MavenGoalTag.java:116) [jrc] at org.apache.maven.werkz.Goal.fire(Goal.java:691) [jrc] at org.apache.maven.werkz.Goal.attain(Goal.java:623) [jrc] at org.apache.maven.werkz.WerkzProject.attainGoal(WerkzProject.java:209) [jrc] at org.apache.maven.jelly.tags.werkz.MavenAttainGoalTag.doTag(MavenAttainGoalTag.java:115) [jrc] at org.apache.commons.jelly.impl.TagScript.run(TagScript.java:250) [jrc] at org.apache.commons.jelly.impl.ScriptBlock.run(ScriptBlock.java:95) [jrc] at org.apache.commons.jelly.TagSupport.invokeBody(TagSupport.java:186) [jrc] at org.apache.maven.werkz.jelly.PostGoalTag$1.firePostGoal(PostGoalTag.java:110) [jrc] at org.apache.maven.werkz.Goal.firePostGoalCallbacks(Goal.java:763) [jrc] at org.apache.maven.werkz.Goal.fire(Goal.java:705) [jrc] at org.apache.maven.werkz.Goal.attain(Goal.java:623) [jrc] at org.apache.maven.werkz.Goal.attainPrecursors(Goal.java:526) [jrc] at org.apache.maven.werkz.Goal.attain(Goal.java:621) [jrc] at org.apache.maven.werkz.Goal.attainPrecursors(Goal.java:526) [jrc] at org.apache.maven.werkz.Goal.attain(Goal.java:621) [jrc] at org.apache.maven.werkz.Goal.attainPrecursors(Goal.java:526) [jrc] at org.apache.maven.werkz.Goal.attain(Goal.java:621) [jrc] at org.apache.maven.plugin.PluginManager.attainGoals(PluginManager.java:712) [jrc] at org.apache.maven.MavenSession.attainGoals(MavenSession.java:265) [jrc] at org.apache.maven.jelly.tags.maven.ReactorTag.doTag(ReactorTag.java:370) [jrc] at org.apache.commons.jelly.impl.TagScript.run(TagScript.java:250) [jrc] at org.apache.commons.jelly.impl.ScriptBlock.run(ScriptBlock.java:95) [jrc] at org.apache.maven.jelly.tags.werkz.MavenGoalTag.runBodyTag(MavenGoalTag.java:83) [jrc] at org.apache.maven.jelly.tags.werkz.MavenGoalTag$MavenGoalAction.performAction(MavenGoalTag.java:116) [jrc] at org.apache.maven.werkz.Goal.fire(Goal.java:691) [jrc] at org.apache.maven.werkz.Goal.attain(Goal.java:623) [jrc] at org.apache.maven.werkz.WerkzProject.attainGoal(WerkzProject.java:209) [jrc] at org.apache.maven.jelly.tags.werkz.MavenAttainGoalTag.doTag(MavenAttainGoalTag.java:115) [jrc] at org.apache.commons.jelly.impl.TagScript.run(TagScript.java:250) [jrc] at org.apache.commons.jelly.impl.ScriptBlock.run(ScriptBlock.java:95) [jrc] at org.apache.maven.jelly.tags.werkz.MavenGoalTag.runBodyTag(MavenGoalTag.java:83) [jrc] at org.apache.maven.jelly.tags.werkz.MavenGoalTag$MavenGoalAction.performAction(MavenGoalTag.java:116) [jrc] at org.apache.maven.werkz.Goal.fire(Goal.java:691) [jrc] at org.apache.maven.werkz.Goal.attain(Goal.java:623) [jrc] at org.apache.maven.plugin.PluginManager.attainGoals(PluginManager.java:712) [jrc] at org.apache.maven.MavenSession.attainGoals(MavenSession.java:265) [jrc] at org.apache.maven.cli.App.doMain(App.java:307) [jrc] at org.apache.maven.cli.App.main(App.java:217) [jrc] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) [jrc] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) [jrc] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) [jrc] at java.lang.reflect.Method.invoke(Method.java:585) [jrc] at com.werken.forehead.Forehead.run(Forehead.java:551) [jrc] at com.werken.forehead.Forehead.main(Forehead.java:581)------------------------------------------------------------------------------->> Unable to obtain goal [app:build]>> Unable to obtain goal [java:compile]>> Errors were encountered when compiling report designs.-------------------------------------------------------------------------------
  15. Dear All, Issue with XML and subReports in a JAR: SubReports are EMPTY (but not when running with iReport). We’re stuck… so we’re calling upon the community again… but this time, we will give 50 USD to the first one who help us to find the answer (payment via PayPal). If we find a solution before you, we will share it here and cancel our offer… We have a rather weird problem: · 1 Master report (billing-confirm.jrxml) calling a subReport (billing-per-txn.jrxml) that itself calls a subReport (billing-txn-accruals.jrxml). · DataSource is XML (billing3.xml) · The report is working fine with iReport 3.0.0 (see billing-ireport.pdf) · Using JasperReports 3.1.3 and the reports under a JAR, the Master report is filled in but the subsequent reports are NOT filled and left empty (using the same data source file 'billing3.xml', see billing-jboss.pdf). The actual files are attached under forum.zip. Why? The reports are generated in com/appendium/pf/server/jasper directory in our JAR file. They are also compiled in such a directory structure with iReport. The Master report can find each subReport. Could you have a look at our JRXML files and how they create a subDataSource? Are these correct? I’d think that the problem is in identifying the datasource for the subreports… MANY THANKS in advance and Good luck! best regards from London Benoit We are filling the report this way: String xml =… InputStream resourceAsStream = ABaseClass.class.getResourceAsStream(“billing-confirm.jasper”); final Object o = JRLoader.loadObject(resourceAsStream); JasperReport reportTemplate = (JasperReport) o; JRDataSource ds = new JRXmlDataSource(new ByteArrayInputStream(xml.getBytes())); JasperPrint report =JasperFillManager.fillReport(reportTemplate, new HashMap(), ds); In the Master report we have: <queryString language="xPath"><![CDATA[/list/correspondenceContent]]></queryString> … <subreport isUsingCache="true"> <reportElement mode="Opaque" x="1" y="57" width="534" height="59" backcolor="#FFCCFF" key="subreport-1"/> <dataSourceExpression><![CDATA[((net.sf.jasperreports.engine.data.JRXmlDataSource)$P{REPORT_DATA_SOURCE}).subDataSource("/correspondenceContent/trade/accrualsPerTransactions/accrualsPerTxn")]]></dataSourceExpression> <subreportExpression class="java.lang.String"><![CDATA["com/appendium/pf/server/jasper/billing-per-txn.jasper"]]></subreportExpression> </subreport>
×
×
  • Create New...