Jump to content

pwork

Members
  • Posts

    12
  • Joined

  • Last visited

pwork's Achievements

Apprentice

Apprentice (3/14)

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

Recent Badges

0

Reputation

  1. Ok, I can reply to myself on this one :D In the father report that instantiates the table of contents subreport, an additional datasource can be created for this very purpose : new net.sf.jasperreports.engine.data.JRBeanCollectionDataSource($V{someCollectionContainingTableOfContentsData})
  2. Hello, I'm building a table of contents for a report, following the JR 3.6.0 sources package sample. Here is the problem I meet : In the sample, the JRXML of the table of contents iterates over some specific fields, that are bound to a CollectionDatasource. Here, I'm using a XML datasource with only usefull data, and don't want to melt some third-party data (titles and pages references) in it. So, titles and pages are stored in a java.util.Collection "variable", and I'd like to know how to iterate on this variable items through the JRXML "detail" band. At the moment, I only use the detail band to iterate over fields data, and don't know if there's a method to have it iterating over a Collection variable. It seems that a group can be linked to a variable, but I don't know how it will iterate on it. Thanks for info :) Post Edited by pwork at 10/07/2009 15:13
  3. Ok, I missed a point : the JasperCompileManager "JasperReport compileReport(JasperDesign jasperDesign) throws JRException" method, and the "NoXmlDesign" sample ;) In fact, I do want to use a JRXML design, but only want to input it the scriptlet class to use from the Java layer, before compilation. This can be done with : JasperDesign jasperDesign = JRXmlLoader.load("path/to/jrxml/file"); jasperDesign.setScriptletClass("package.to.custom.scriptlet.Object"); Alternatively, is there a jasperreports.properties key to set the default scriptlet class ? All things apart, you should maximize the posts title length : atm, it's very hard to properly describe the post subject with all keywords. As as result, the forums searches results may loose accuracy. Solved anyway Post Edited by pwork at 10/06/2009 11:05
  4. Hello, As far as I know, a custom scriptlet class can be linked in a JasperReport object at JRXML report compilation time, using the 'report' tag 'scriptletClass' attribute. For code privacy reasons, I don't wan't some "com.somecompany.SomeCustomScriptlet" value to be set in this 'scriptletClass' attribute. Concerning another JR aspect, information can be hidden, because it's linked at fill time : when passing a subreport, it can be linked to a JRXML file by providing the JASPER file path (no-privacy), or the compiled JasperReport object (privacy). So, since compiler complains at report compile time, is there some way to put this information at JRXML compilation time, not in the JRXML, but through the underlying Java code (JasperCompileManager.compileReport(..)) ? I found no answer on this when searching the forum. Thanks for info :) Post Edited by pwork at 10/05/2009 18:04
  5. I thank both of you for this piece of information, since it shows me the direction to follow to reach this goal (was a little confused to get outside of DOM ;)).
  6. Hello, I'm using an XML datasource to feed the compiled .jrxml at filling time. But even if I tweaked the JVM, the output XML data docuement is very very big, so that runtime ends in a stack overflow. So, instead of using XML DOM (org.w3c.Document doc = JRXmlUtils.parse(...); jasperParams.put(JRXPathQueryExecuterFactory.PARAMETER_XML_DATA_DOCUMENT, doc);), I wonder if a .jrxml compilation/fill is possible by feeding the params with an XML SAX parser instead of a whole XML DOM document that potentially can use all available memory. Thanks to the JR team to point some ideas to avoid getting a 100 000 lines XML DOM document to go in memory ;) Post Edited by pwork at 09/30/2009 07:38
  7. Ok, solved : this is not a font export error. In the app I'm working on, fonts are located in many places, so that it can't be put in the classpath. In addition, the absolute path to the font can't be provided in the jrxml, for safety reasons. So, at design time, a relative path is set in the .jrxml, and then, the absolute path is set by the Java app in the corresponding style objects contained in the JasperPrint object of the main report. I made this "relative to absolute" operation for the main report only, after fill, and font couldn't be found on elements (text, graph, ..) contained in subreports : in main report, path was changed to absolute, but it remained relative in subreports. So I just forgot to do the same replacement after subreports compilation, before adding them to the main report-filling parameters map ;) Hope this monologue will help you to deal with fonts embedding.
  8. Hello, (unrelated) Thanks in advance for help :) Post Edited by pwork at 09/10/2009 21:06
×
×
  • Create New...