Jump to content
Changes to the Jaspersoft community edition download ×

klingela

Members
  • Posts

    6
  • Joined

  • Last visited

 Content Type 

Profiles

Forum

Events

Featured Visualizations

Knowledge Base

Documentation (PDF Downloads)

Blog

Documentation (Test Area)

Documentation

Dr. Jaspersoft Webinar Series

Downloads

Everything posted by klingela

  1. It works. I had to change the detail pages to "Split Type = Immediate".
  2. And I am certain you are right. I am certain that some of the data will be bigger than a single page. How do I tell the jrxml or the subreport to allow the split?
  3. I would be happy to upload the JRXMLs (there is a subreport and a sub-subreport). Is there a way to upload them here?
  4. I have a simple Java program that takes a .jrxml file, compiles it, then fills it. The data for the report is supplied in an XML file. After the fill is done, the data is exported to PDF. // Parse input documentDocument document = JRXmlUtils.parse(new File(xmlFile));// Set it as the data source in the parametersparameters.put(JRXPathQueryExecuterFactory.PARAMETER_XML_DATA_DOCUMENT, document);// Create and set the virtualizerJRFileVirtualizer virtualizer = new JRFileVirtualizer(2, "/tmp");virtualizer.setReadOnly(true);parameters.put(JRParameter.REPORT_VIRTUALIZER, virtualizer);// Fill the reportString jasperFile = designFile.replaceAll(".jrxml",".jasper");print = JasperFillManager.fillReport(jasperFile, parameters);// Export the report to PDFArrayList<JasperPrint> jasperPrints = new ArrayList<JasperPrint>();jasperPrints.add(print);JRPdfExporter exp = new JRPdfExporter();exp.setParameter (JRExporterParameter.JASPER_PRINT_LIST, jasperPrints);exp.setParameter(JRExporterParameter.OUTPUT_FILE_NAME, outFileName );exp.exportReport();[/code]My confusion is about the export That fill line above works great for small reports, but once I get an XML source file approaching 1/2 MB, it will spin for over a day, regardless of setting the file virtualizer (which I do). I see there is another method called fillReportToSteam. My confusion is that with fillReport, I have to do an extra step to export to PDF. What sort of stream is fillReportToStream writing to, and how do I specify that? Will fillReportToStream write to a PDF file? I haven't been able to find any examples. I was hoping I could take advantage of the stream so that I could measure the progress and get these PDFs to complete in a normal span of time. UPDATE: fillReportToStream doesn't work for PDF files, at least in 4.7. That's extremely unfortunate. It "creates" a PDF file, but it's corrups and can't be read. And even then, it doesn't work any different than what I do above. In other words, for my 1/2 MB source file, it just sits and churns forever with the PDF file at 0 bytes. UPDATE 2: Looks like it creates JasperPrint files. UPDATE 3: I have the "streaming" solution working for an extremely small file. But for the "large" file (like 1/2 of a MB is large) it churns at 100% CPU for 2 hours, and the file that is supposed to be "streamed" to is still at zero bytes. The hits seem to keep coming with this JasperReports library. I've done some interesting stuff with it in the past, but ever since I "upgraded" from 3.5 to 4.7, I am dead in the water.
  5. I have a report that print a large catalog. To save space on the page, I am extracting certain notes and replacing them with a numerical entity reference so that I can put a footnote key at the bottom of each page. For example, if a catalog item description contains the text "Seal included.", then at the bottom of the page I have: ◊ Seal Included That entity reference resolves to a "lozenge" in ISO-8859-1. Another one might be: ⇒ for a check mark. These show up just fine when I export to HTML, but disappear when I export to PDF. I have tried a WHOLE BUNCH of different PDF fonts via iReport, to no avail. Does anyone know of a font which displays these characters? Code:◊ Seal Included⇒
  6. This example compiles and runs successfully, but it generates 0 pages. It doesn't generate anything when supplied with a "1" or a "2" for the parameter prompt. ######### UPDATE ####### I DID get this to generate data, I had a problem in the data source I set up for the example, which I fixed ######################### This is kind of a funny XML file to show for an example. This XML file is set up with Master/Detail relationships. Most XML files have the entire hierarchy built into each element. The structure of this example is: <order> <packstr/> <packstr/> <packstr/> </order> <orderarticle> <article/> <article/> <article/> <article/> </orderarticle> You are much more likely to see: <order> <packstr> <orderarticles> <article/> <article/> <article/> <article/> </orderarticle> </order> in which case I guess you'd need to provide a subDataSource rather than a dataSource. But I don't know, because there's almost zero documentation and the Definitive Guide book examples are incorrect. Trial and error is proving to be extremely difficult to troubleshoot this problem. I do appreciate your effort though. My main problem is that I get a runtime exception "ClassCastException" for the subdatasource I create with the following line: ((net.sf.jasperreports.engine.data.JRXmlDataSource)$P{REPORT_DATA_SOURCE}).subDataSource("/Master/Sub") I've tried pretty much everything, and it will not progress beyond that ClassCastException. Post Edited by klingela at 07/06/2009 20:16
×
×
  • Create New...