salishs Posted December 4, 2009 Share Posted December 4, 2009 Hi,i dwld ireport iReport-3.6.2 .There is detail1 on compiling and runing it will gave output ,but when call by java pgm it wont display any thing in detail portion but others are working correctly why ? Link to comment Share on other sites More sharing options...
jamesthornley Posted December 7, 2009 Share Posted December 7, 2009 I have the same problem, I've spent a couple of days on this and have now reduced it to the simplest example I can give, the jrxml simply prints hello on the detail line, which it does when run in ireport. However, when I run it from within java, it prints nothing.I have attached the jrxml in the code section, and the java I am using to call it looks like this (the jasper file is created by ireport) - it produces a pdf file with nothing in it - any help greatly appreciated. // this map could be filled with parameters defined in the reportMap parameters =new HashMap();File reportFile = } new File("report3.jasper");if (!reportFile.exists()) {throw new Exception(getReportFile() + " not found ");// load up the reportJasperPrint jasperPrint = JasperFillManager.fillReport(getReportFile(), parameters,JRPdfExporter exp =exp.setParameter(JRExporterParameter.exp.setParameter(JRExporterParameter.exp.exportReport(); new JREmptyDataSource() );new JRPdfExporter();JASPER_PRINT, jasperPrint);OUTPUT_FILE_NAME, pdfFile); The log of this looks like this, and you can see it is not 'filling' the detail0 [main] DEBUG net.sf.jasperreports.extensions.ExtensionsEnvironment - Instantiating extensions registry class net.sf.jasperreports.extensions.DefaultExtensionsRegistry16 [main] DEBUG net.sf.jasperreports.extensions.DefaultExtensionsRegistry - Loading JasperReports extension properties resource jar:file:/C:/Users/James/Documents/Eclipse%20shared%20libraries/jasperreports-3.5.1-project/jasperreports-3.5.1/dist/jasperreports-3.5.1.jar!/jasperreports_extension.properties16 [main] DEBUG net.sf.jasperreports.extensions.DefaultExtensionsRegistry - Instantiating extensions registry for default using factory class net.sf.jasperreports.extensions.DefaultExtensionsRegistryFactory16 [main] DEBUG net.sf.jasperreports.extensions.DefaultExtensionsRegistry - Instantiating extensions registry for governor using factory class net.sf.jasperreports.governors.GovernorExtensionsRegistryFactory16 [main] DEBUG net.sf.jasperreports.extensions.DefaultExtensionsRegistry - Instantiating extensions registry for components using factory class net.sf.jasperreports.components.ComponentsExtensionsRegistryFactory655 [main] DEBUG net.sf.jasperreports.engine.fill.JRBaseFiller - Fill 31538695: created for report3780 [main] DEBUG net.sf.jasperreports.engine.fill.JRBaseFiller - Fill 31538695: filling report828 [main] DEBUG net.sf.jasperreports.engine.fill.JRBaseFiller - Fill 31538695: adding page 1828 [main] DEBUG net.sf.jasperreports.engine.fill.JRVerticalFiller - Fill 31538695: title828 [main] DEBUG net.sf.jasperreports.engine.fill.JRVerticalFiller - Fill 31538695: page header828 [main] DEBUG net.sf.jasperreports.engine.fill.JRVerticalFiller - Fill 31538695: column header828 [main] DEBUG net.sf.jasperreports.engine.fill.JRVerticalFiller - Fill 31538695: summary828 [main] DEBUG net.sf.jasperreports.engine.fill.JRVerticalFiller - Fill 31538695: column footer828 [main] DEBUG net.sf.jasperreports.engine.fill.JRVerticalFiller - Fill 31538695: page footer828 [main] DEBUG net.sf.jasperreports.engine.fill.JRBaseFiller - Fill 31538695: ended Code:<?xml version="1.0" encoding="UTF-8"?><jasperReport xmlns="http://jasperreports.sourceforge.net/jasperreports" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://jasperreports.sourceforge.net/jasperreports http://jasperreports.sourceforge.net/xsd/jasperreport.xsd" name="report3" pageWidth="595" pageHeight="842" columnWidth="555" leftMargin="20" rightMargin="20" topMargin="20" bottomMargin="20"> <background> <band splitType="Stretch"/> </background> <title> <band height="79" splitType="Stretch"/> </title> <pageHeader> <band height="35" splitType="Stretch"/> </pageHeader> <columnHeader> <band height="61" splitType="Stretch"/> </columnHeader> <detail> <band height="125" splitType="Stretch"> <staticText> <reportElement x="176" y="54" width="100" height="20"/> <textElement/> <text><![CDATA[hello]]></text> </staticText> </band> </detail> <columnFooter> <band height="45" splitType="Stretch"/> </columnFooter> <pageFooter> <band height="54" splitType="Stretch"/> </pageFooter> <summary> <band height="42" splitType="Stretch"/> </summary></jasperReport> Link to comment Share on other sites More sharing options...
jamesthornley Posted December 7, 2009 Share Posted December 7, 2009 Sorry, the java code didn't paste very well - I've attached it here as code.ThanksJamesCode: Map parameters = new HashMap(); File reportFile = new File("report3.jasper"); if (!reportFile.exists()) { throw new Exception(getReportFile() + " not found "); } // load up the report JasperPrint jasperPrint = JasperFillManager.fillReport(getReportFile(), parameters,new JREmptyDataSource() ); JRPdfExporter exp = new JRPdfExporter(); exp.setParameter(JRExporterParameter.JASPER_PRINT, jasperPrint); exp.setParameter(JRExporterParameter.OUTPUT_FILE_NAME, pdfFile); exp.exportReport(); Link to comment Share on other sites More sharing options...
salishs Posted December 8, 2009 Author Share Posted December 8, 2009 HaiThis is the problem due to the jasper report 3.6.2please use iReport-3.0.0 if u has and do the same if u got it then ok if any other error then pls replay me steps i docopied ur jrxml opened by my iReport-3.0.0 created the jasper and run by java got the output but iReport-3.6.2 it willl not that i'm also searching if u get any help pls replaythanks Link to comment Share on other sites More sharing options...
salishs Posted December 8, 2009 Author Share Posted December 8, 2009 HaiThis is the problem due to the jasper report 3.6.2please use iReport-3.0.0 if u has and do the same if u got it then ok if any other error then pls replay me steps i docopied ur jrxml opened by my iReport-3.0.0 created the jasper and run by java got the output but iReport-3.6.2 it willl not that i'm also searching if u get any help pls replaythanks Link to comment Share on other sites More sharing options...
salishs Posted December 8, 2009 Author Share Posted December 8, 2009 Hi,The same when done with irepor3.0.0the jrxml is<?xml version="1.0" encoding="UTF-8" ?><!-- Created with iReport - A designer for JasperReports --><!DOCTYPE jasperReport PUBLIC "//JasperReports//DTD Report Design//EN" "http://jasperreports.sourceforge.net/dtds/jasperreport.dtd"><jasperReport name="Check" columnCount="1" printOrder="Vertical" orientation="Portrait" pageWidth="595" pageHeight="842" columnWidth="535" columnSpacing="0" leftMargin="30" rightMargin="30" topMargin="20" bottomMargin="20" whenNoDataType="NoPages" isTitleNewPage="false" isSummaryNewPage="false"> <property name="ireport.scriptlethandling" value="2" /> <property name="ireport.encoding" value="UTF-8" /> <import value="java.util.*" /> <import value="net.sf.jasperreports.engine.*" /> <import value="net.sf.jasperreports.engine.data.*" /> <background> <band height="0" isSplitAllowed="true" > </band> </background> <title> <band height="50" isSplitAllowed="true" > </band> </title> <pageHeader> <band height="50" isSplitAllowed="true" > </band> </pageHeader> <columnHeader> <band height="30" isSplitAllowed="true" > </band> </columnHeader> <detail> <band height="100" isSplitAllowed="true" > <staticText> <reportElement x="96" y="42" width="181" height="31" key="staticText-1"/> <box></box> <textElement> <font/> </textElement> <text><![CDATA[Hello]]></text> </staticText> </band> </detail> <columnFooter> <band height="30" isSplitAllowed="true" > </band> </columnFooter> <pageFooter> <band height="50" isSplitAllowed="true" > </band> </pageFooter> <lastPageFooter> <band height="50" isSplitAllowed="true" > </band> </lastPageFooter> <summary> <band height="50" isSplitAllowed="true" > </band> </summary></jasperReport> see the difference pls use thisthanks Link to comment Share on other sites More sharing options...
Chobicus Posted January 21, 2011 Share Posted January 21, 2011 I had the same problem. Details band does not print in Java if I compile to jasper from iReport 3.7.1. If I compile to jasper from iReport 3.0.0. Java prints it without any problem. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now