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

manumtl

Members
  • Posts

    5
  • 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 manumtl

  1. ok I just read in this forum For the PDF export task of the Barbecue sample you have to provide the serialiazed jasper print (.jrprint) file. This object/file is obtained by compiling and filling the report design (.jrxml). thank.
  2. ok I just read in this forum For the PDF export task of the Barbecue sample you have to provide the serialiazed jasper print (.jrprint) file. This object/file is obtained by compiling and filling the report design (.jrxml). thank.
  3. Hello everybody ,I m only try to run the sample BarbecueApp for the version JasperReports-0.6.1-project wuth ant and I a got a message D:\HydroDev\Projets\partique\jasper>ant csv Buildfile: D:\HydroDev\Projets\partique\jasper\build.xml csv: [java] java.io.EOFException [java] at java.io.ObjectInputStream$PeekInputStream.readFully(ObjectInp utStream.java:2281) [java] at java.io.ObjectInputStream$BlockDataInputStream.readShort(Obje ctInputStream.java:2750) [java] at java.io.ObjectInputStream.readStreamHeader(ObjectInputStream. java:780) [java] at java.io.ObjectInputStream.<init>(ObjectInputStream.java:280) [java] at net.sf.jasperreports.engine.util.JRLoader.loadObject(JRLoader .java:128) [java] at BarbecueApp.main(BarbecueApp.java:243) [java] [java] NESTED BY : [java] java.io.EOFException [java] at java.io.ObjectInputStream$PeekInputStream.readFully(ObjectInp utStream.java:2281) [java] at java.io.ObjectInputStream$BlockDataInputStream.readShort(Obje ctInputStream.java:2750) [java] at java.io.ObjectInputStream.readStreamHeader(ObjectInputStream. java:780) [java] at java.io.ObjectInputStream.<init>(ObjectInputStream.java:280) [java] at net.sf.jasperreports.engine.util.JRLoader.loadObject(JRLoader .java:128) [java] at BarbecueApp.main(BarbecueApp.java:243) [java] [java] NESTED BY : [java] net.sf.jasperreports.engine.JRException: Error loading object from f ile : BarbecueReport.jrprint [java] at net.sf.jasperreports.engine.util.JRLoader.loadObject(JRLoader .java:133) [java] at BarbecueApp.main(BarbecueApp.java:243) [java] Caused by: java.io.EOFException [java] at java.io.ObjectInputStream$PeekInputStream.readFully(ObjectInp utStream.java:2281) [java] at java.io.ObjectInputStream$BlockDataInputStream.readShort(Obje ctInputStream.java:2750) [java] at java.io.ObjectInputStream.readStreamHeader(ObjectInputStream. java:780) [java] at java.io.ObjectInputStream.<init>(ObjectInputStream.java:280) [java] at net.sf.jasperreports.engine.util.JRLoader.loadObject(JRLoader .java:128) [java] ... 1 more [java] Java Result: 1 BUILD SUCCESSFUL Total time: 1 second OR D:\HydroDev\Projets\partique\jasper>ant pdf Buildfile: D:\HydroDev\Projets\partique\jasper\build.xml pdf: [java] log4j:WARN No appenders could be found for logger (org.apache.common s.digester.Digester.sax). [java] log4j:WARN Please initialize the log4j system properly. [java] org.xml.sax.SAXParseException: The root element is required in a wel l-formed document. [java] at org.apache.xerces.framework.XMLParser.reportError(XMLParser.j ava:1213) [java] at org.apache.xerces.framework.XMLDocumentScanner.reportFatalXML Error(XMLDocumentScanner.java:570) [java] at org.apache.xerces.framework.XMLDocumentScanner$XMLDeclDispatc her.endOfInput(XMLDocumentScanner.java:790) [java] at org.apache.xerces.framework.XMLDocumentScanner.endOfInput(XML DocumentScanner.java:418) [java] at org.apache.xerces.validators.common.XMLValidator.sendEndOfInp utNotifications(XMLValidator.java:712) [java] at org.apache.xerces.readers.DefaultEntityHandler.changeReaders( DefaultEntityHandler.java:1031) [java] at org.apache.xerces.readers.XMLEntityReader.changeReaders(XMLEn tityReader.java:168) [java] at org.apache.xerces.readers.UTF8Reader.changeReaders(UTF8Reader .java:182) [java] at org.apache.xerces.readers.UTF8Reader.lookingAtChar(UTF8Reader .java:197) [java] at org.apache.xerces.framework.XMLDocumentScanner$XMLDeclDispatc her.dispatch(XMLDocumentScanner.java:686) [java] at org.apache.xerces.framework.XMLDocumentScanner.parseSome(XMLD ocumentScanner.java:381) [java] at org.apache.xerces.framework.XMLParser.parse(XMLParser.java:10 98) [java] at org.apache.commons.digester.Digester.parse(Digester.java:1591 ) [java] at net.sf.jasperreports.engine.xml.JRXmlLoader.loadXML(JRXmlLoad er.java:400) [java] at net.sf.jasperreports.engine.xml.JRXmlLoader.load(JRXmlLoader. java:384) [java] at net.sf.jasperreports.engine.xml.JRXmlLoader.load(JRXmlLoader. java:338) [java] at net.sf.jasperreports.engine.xml.JRXmlLoader.load(JRXmlLoader. java:322) [java] at net.sf.jasperreports.engine.JasperCompileManager.compileRepor tToFile(JasperCompileManager.java:109) [java] at BarbecueApp.main(BarbecueApp.java:173) [java] [java] NESTED BY : [java] org.xml.sax.SAXParseException: The root element is required in a wel l-formed document. [java] at org.apache.xerces.framework.XMLParser.reportError(XMLParser.j ava:1213) [java] at org.apache.xerces.framework.XMLDocumentScanner.reportFatalXML Error(XMLDocumentScanner.java:570) [java] at org.apache.xerces.framework.XMLDocumentScanner$XMLDeclDispatc her.endOfInput(XMLDocumentScanner.java:790) [java] at org.apache.xerces.framework.XMLDocumentScanner.endOfInput(XML DocumentScanner.java:418) [java] at org.apache.xerces.validators.common.XMLValidator.sendEndOfInp utNotifications(XMLValidator.java:712) [java] at org.apache.xerces.readers.DefaultEntityHandler.changeReaders( DefaultEntityHandler.java:1031) [java] at org.apache.xerces.readers.XMLEntityReader.changeReaders(XMLEn tityReader.java:168) [java] at org.apache.xerces.readers.UTF8Reader.changeReaders(UTF8Reader .java:182) [java] at org.apache.xerces.readers.UTF8Reader.lookingAtChar(UTF8Reader .java:197) [java] at org.apache.xerces.framework.XMLDocumentScanner$XMLDeclDispatc her.dispatch(XMLDocumentScanner.java:686) [java] at org.apache.xerces.framework.XMLDocumentScanner.parseSome(XMLD ocumentScanner.java:381) [java] at org.apache.xerces.framework.XMLParser.parse(XMLParser.java:10 98) [java] at org.apache.commons.digester.Digester.parse(Digester.java:1591 ) [java] at net.sf.jasperreports.engine.xml.JRXmlLoader.loadXML(JRXmlLoad er.java:400) [java] at net.sf.jasperreports.engine.xml.JRXmlLoader.load(JRXmlLoader. java:384) [java] at net.sf.jasperreports.engine.xml.JRXmlLoader.load(JRXmlLoader. java:338) [java] at net.sf.jasperreports.engine.xml.JRXmlLoader.load(JRXmlLoader. java:322) [java] at net.sf.jasperreports.engine.JasperCompileManager.compileRepor tToFile(JasperCompileManager.java:109) [java] at BarbecueApp.main(BarbecueApp.java:173) [java] [java] NESTED BY : [java] net.sf.jasperreports.engine.JRException: The root element is require d in a well-formed document. [java] at net.sf.jasperreports.engine.xml.JRXmlLoader.loadXML(JRXmlLoad er.java:404) [java] at net.sf.jasperreports.engine.xml.JRXmlLoader.load(JRXmlLoader. java:384) [java] at net.sf.jasperreports.engine.xml.JRXmlLoader.load(JRXmlLoader. java:338) [java] at net.sf.jasperreports.engine.xml.JRXmlLoader.load(JRXmlLoader. java:322) [java] at net.sf.jasperreports.engine.JasperCompileManager.compileRepor tToFile(JasperCompileManager.java:109) [java] at BarbecueApp.main(BarbecueApp.java:173) [java] Caused by: org.xml.sax.SAXParseException: The root element is requir ed in a well-formed document. [java] at org.apache.xerces.framework.XMLParser.reportError(XMLParser.j ava:1213) [java] at org.apache.xerces.framework.XMLDocumentScanner.reportFatalXML Error(XMLDocumentScanner.java:570) [java] at org.apache.xerces.framework.XMLDocumentScanner$XMLDeclDispatc her.endOfInput(XMLDocumentScanner.java:790) [java] at org.apache.xerces.framework.XMLDocumentScanner.endOfInput(XML DocumentScanner.java:418) [java] at org.apache.xerces.validators.common.XMLValidator.sendEndOfInp utNotifications(XMLValidator.java:712) [java] at org.apache.xerces.readers.DefaultEntityHandler.changeReaders( DefaultEntityHandler.java:1031) [java] at org.apache.xerces.readers.XMLEntityReader.changeReaders(XMLEn tityReader.java:168) [java] at org.apache.xerces.readers.UTF8Reader.changeReaders(UTF8Reader .java:182) [java] at org.apache.xerces.readers.UTF8Reader.lookingAtChar(UTF8Reader .java:197) [java] at org.apache.xerces.framework.XMLDocumentScanner$XMLDeclDispatc her.dispatch(XMLDocumentScanner.java:686) [java] at org.apache.xerces.framework.XMLDocumentScanner.parseSome(XMLD ocumentScanner.java:381) [java] at org.apache.xerces.framework.XMLParser.parse(XMLParser.java:10 98) [java] at org.apache.commons.digester.Digester.parse(Digester.java:1591 ) [java] at net.sf.jasperreports.engine.xml.JRXmlLoader.loadXML(JRXmlLoad er.java:400) [java] ... 5 more [java] Java Result: 1 I think ,I need some support thank
  4. Hello gertbeedfrobe, thank to get back to me. I m only try to run the sample BarbecueApp for the version JasperReports-0.6.1-project for a java application. I think my problem is in the argument Tcsv- Ftest if I put a file name test a got a message java.io.EOFException at java.io.ObjectInputStream$PeekInputStream.readFully(ObjectInputStream.java:2281) at java.io.ObjectInputStream$BlockDataInputStream.readShort(ObjectInputStream.java:2750) at java.io.ObjectInputStream.readStreamHeader(ObjectInputStream.java:780) at java.io.ObjectInputStream.<init>(ObjectInputStream.java:280) at net.sf.jasperreports.engine.util.JRLoader.loadObject(JRLoader.java:128) at BarbecueApp.main(BarbecueApp.java:206) NESTED BY : java.io.EOFException at java.io.ObjectInputStream$PeekInputStream.readFully(ObjectInputStream.java:2281) at java.io.ObjectInputStream$BlockDataInputStream.readShort(ObjectInputStream.java:2750) at java.io.ObjectInputStream.readStreamHeader(ObjectInputStream.java:780) at java.io.ObjectInputStream.<init>(ObjectInputStream.java:280) at net.sf.jasperreports.engine.util.JRLoader.loadObject(JRLoader.java:128) at BarbecueApp.main(BarbecueApp.java:206) NESTED BY : net.sf.jasperreports.engine.JRException: Error loading object from file : test at net.sf.jasperreports.engine.util.JRLoader.loadObject(JRLoader.java:133) at BarbecueApp.main(BarbecueApp.java:206) Caused by: java.io.EOFException at java.io.ObjectInputStream$PeekInputStream.readFully(ObjectInputStream.java:2281) at java.io.ObjectInputStream$BlockDataInputStream.readShort(ObjectInputStream.java:2750) at java.io.ObjectInputStream.readStreamHeader(ObjectInputStream.java:780) at java.io.ObjectInputStream.<init>(ObjectInputStream.java:280) at net.sf.jasperreports.engine.util.JRLoader.loadObject(JRLoader.java:128) ... 1 more if I not put the file java.io.FileNotFoundException: test at net.sf.jasperreports.engine.util.JRLoader.loadObject(JRLoader.java:117) at BarbecueApp.main(BarbecueApp.java:206) NESTED BY : java.io.FileNotFoundException: test at net.sf.jasperreports.engine.util.JRLoader.loadObject(JRLoader.java:117) at BarbecueApp.main(BarbecueApp.java:206) NESTED BY : net.sf.jasperreports.engine.JRException: test at net.sf.jasperreports.engine.util.JRLoader.loadObject(JRLoader.java:117) at BarbecueApp.main(BarbecueApp.java:206) Caused by: java.io.FileNotFoundException: test ... 2 more Code:/* * ============================================================================ * The JasperReports License, Version 1.0 * ============================================================================ * * Copyright (C) 2001-2004 Teodor Danciu (teodord@users.sourceforge.net). All rights reserved. * * Redistribution and use in source and binary forms, with or without modification, * are permitted provided that the following conditions are met: * * 1. Redistributions of source code must retain the above copyright notice, * this list of conditions and the following disclaimer. * * 2. Redistributions in binary form must reproduce the above copyright notice, * this list of conditions and the following disclaimer in the documentation * and/or other materials provided with the distribution. * * 3. The end-user documentation included with the redistribution, if any, must * include the following acknowledgment: "This product includes software * developed by Teodor Danciu (http://jasperreports.sourceforge.net)." * Alternately, this acknowledgment may appear in the software itself, if * and wherever such third-party acknowledgments normally appear. * * 4. The name "JasperReports" must not be used to endorse or promote products * derived from this software without prior written permission. For written * permission, please contact teodord@users.sourceforge.net. * * 5. Products derived from this software may not be called "JasperReports", nor * may "JasperReports" appear in their name, without prior written permission * of Teodor Danciu. * * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED WARRANTIES, * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE * APACHE SOFTWARE FOUNDATION OR ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLU- * DING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. *//* * ============================================================================ * GNU Lesser General Public License * ============================================================================ * * JasperReports - Free Java report-generating library. * Copyright (C) 2001-2004 Teodor Danciu teodord@users.sourceforge.net * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. * * Teodor Danciu * 173, Calea Calarasilor, Bl. 42, Sc. 1, Ap. 18 * Postal code 030615, Sector 3 * Bucharest, ROMANIA * Email: teodord@users.sourceforge.net */import java.io.File;import net.sf.jasperreports.engine.JREmptyDataSource;import net.sf.jasperreports.engine.JRException;import net.sf.jasperreports.engine.JRExporterParameter;import net.sf.jasperreports.engine.JasperCompileManager;import net.sf.jasperreports.engine.JasperExportManager;import net.sf.jasperreports.engine.JasperFillManager;import net.sf.jasperreports.engine.JasperPrint;import net.sf.jasperreports.engine.JasperPrintManager;import net.sf.jasperreports.engine.JasperRunManager;import net.sf.jasperreports.engine.export.JRCsvExporter;import net.sf.jasperreports.engine.export.JRXlsExporter;import net.sf.jasperreports.engine.export.JRXlsExporterParameter;import net.sf.jasperreports.engine.util.JRLoader;/** * @author Teodor Danciu (teodord@users.sourceforge.net) * @version $Id: BarbecueApp.java,v 1.1 2004/08/18 15:00:42 teodord Exp $ */public class BarbecueApp{ /** * */ private static final String TASK_COMPILE = "compile"; private static final String TASK_FILL = "fill"; private static final String TASK_PRINT = "print"; private static final String TASK_PDF = "pdf"; private static final String TASK_XML = "xml"; private static final String TASK_XML_EMBED = "xmlEmbed"; private static final String TASK_HTML = "html"; private static final String TASK_XLS = "xls"; private static final String TASK_CSV = "csv"; private static final String TASK_RUN = "run"; /** * */ public static void main(String[] args) { String fileName = null; String taskName = null; if(args.length == 0) { usage(); return; } int k = 0; while ( args.length > k ) { if ( args[k].startsWith("-T") ) taskName = args[k].substring(2); if ( args[k].startsWith("-F") ) fileName = args[k].substring(2); k++; } try { long start = System.currentTimeMillis(); if (TASK_COMPILE.equals(taskName)) { JasperCompileManager.compileReportToFile(fileName); System.err.println("Compile time : " + (System.currentTimeMillis() - start)); System.exit(0); } else if (TASK_FILL.equals(taskName)) { JasperFillManager.fillReportToFile(fileName, null, new JREmptyDataSource()); System.err.println("Filling time : " + (System.currentTimeMillis() - start)); System.exit(0); } else if (TASK_PRINT.equals(taskName)) { JasperPrintManager.printReport(fileName, true); System.err.println("Printing time : " + (System.currentTimeMillis() - start)); System.exit(0); } else if (TASK_PDF.equals(taskName)) { JasperExportManager.exportReportToPdfFile(fileName); System.err.println("PDF creation time : " + (System.currentTimeMillis() - start)); System.exit(0); } else if (TASK_XML.equals(taskName)) { JasperExportManager.exportReportToXmlFile(fileName, false); System.err.println("XML creation time : " + (System.currentTimeMillis() - start)); System.exit(0); } else if (TASK_XML_EMBED.equals(taskName)) { JasperExportManager.exportReportToXmlFile(fileName, true); System.err.println("XML creation time : " + (System.currentTimeMillis() - start)); System.exit(0); } else if (TASK_HTML.equals(taskName)) { JasperExportManager.exportReportToHtmlFile(fileName); System.err.println("HTML creation time : " + (System.currentTimeMillis() - start)); System.exit(0); } else if (TASK_XLS.equals(taskName)) { File sourceFile = new File(fileName); JasperPrint jasperPrint = (JasperPrint)JRLoader.loadObject(sourceFile); File destFile = new File(sourceFile.getParent(), jasperPrint.getName() + ".xls"); JRXlsExporter exporter = new JRXlsExporter(); exporter.setParameter(JRExporterParameter.JASPER_PRINT, jasperPrint); exporter.setParameter(JRExporterParameter.OUTPUT_FILE_NAME, destFile.toString()); exporter.setParameter(JRXlsExporterParameter.IS_ONE_PAGE_PER_SHEET, Boolean.TRUE); exporter.exportReport(); System.err.println("XLS creation time : " + (System.currentTimeMillis() - start)); System.exit(0); } else if (TASK_CSV.equals(taskName)) { File sourceFile = new File(fileName); JasperPrint jasperPrint = (JasperPrint)JRLoader.loadObject(sourceFile); File destFile = new File(sourceFile.getParent(), jasperPrint.getName() + ".csv"); JRCsvExporter exporter = new JRCsvExporter(); exporter.setParameter(JRExporterParameter.JASPER_PRINT, jasperPrint); exporter.setParameter(JRExporterParameter.OUTPUT_FILE_NAME, destFile.toString()); exporter.exportReport(); System.err.println("CSV creation time : " + (System.currentTimeMillis() - start)); System.exit(0); } else if (TASK_RUN.equals(taskName)) { JasperRunManager.runReportToPdfFile(fileName, null, new JREmptyDataSource()); System.err.println("PDF running time : " + (System.currentTimeMillis() - start)); System.exit(0); } else { usage(); System.exit(0); } } catch (JRException e) { e.printStackTrace(); System.exit(1); } catch (Exception e) { e.printStackTrace(); System.exit(1); } } /** * */ private static void usage() { System.out.println( "BarbecueApp usage:" ); System.out.println( "\tjava BarbecueApp -Ttask -Ffile" ); System.out.println( "\tTasks : compile | fill | print | pdf | xml | xmlEmbed | html | xls | csv | run" ); }}
  5. Hello everyone, I am currently on JasperReports-0.6.1-project And I try to run the example BarbecueApp As an argument. Tcsv- Ftestss- but when I run it. I have ajava.io.EOFException at java.io.ObjectInputStream$PeekInputStream.readFully(ObjectInputStream.java:2230) at java.io.ObjectInputStream$BlockDataInputStream.readShort(ObjectInputStream.java:2696) at java.io.ObjectInputStream.readStreamHeader(ObjectInputStream.java:761) at java.io.ObjectInputStream.<init>(ObjectInputStream.java:277) at net.sf.jasperreports.engine.util.JRLoader.loadObject(JRLoader.java:128) at com.hydroquebec.mac.ssep.ce.util.rapport.jasperreport.BarbecueApp.main(BarbecueApp.java:214) but the code is simple Code:if (TASK_CSV.equals(taskName)) {File sourceFile = new File(fileName); //File sourceFile = new File(contextReportFile); boolean creer = sourceFile.createNewFile(); if(!creer) creer = sourceFile.mkdir(); JasperPrint jasperPrint = (JasperPrint)JRLoader.loadObject(sourceFile); File destFile = new File(sourceFile.getParent(), jasperPrint.getName() + ".csv"); JRCsvExporter exporter = new JRCsvExporter(); exporter.setParameter(JRExporterParameter.JASPER_PRINT, jasperPrint); exporter.setParameter(JRExporterParameter.OUTPUT_FILE_NAME, destFile.toString()); exporter.exportReport();}
×
×
  • Create New...