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

detail1 problem in ireport iReport-3.6.2 .


salishs

Recommended Posts

  • Replies 6
  • Created
  • Last Reply

Top Posters In This Topic

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 report

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,

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 detail

0 [main] DEBUG net.sf.jasperreports.extensions.ExtensionsEnvironment - Instantiating extensions registry class net.sf.jasperreports.extensions.DefaultExtensionsRegistry

16 [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.properties

16 [main] DEBUG net.sf.jasperreports.extensions.DefaultExtensionsRegistry - Instantiating extensions registry for default using factory class net.sf.jasperreports.extensions.DefaultExtensionsRegistryFactory

16 [main] DEBUG net.sf.jasperreports.extensions.DefaultExtensionsRegistry - Instantiating extensions registry for governor using factory class net.sf.jasperreports.governors.GovernorExtensionsRegistryFactory

16 [main] DEBUG net.sf.jasperreports.extensions.DefaultExtensionsRegistry - Instantiating extensions registry for components using factory class net.sf.jasperreports.components.ComponentsExtensionsRegistryFactory

655 [main] DEBUG net.sf.jasperreports.engine.fill.JRBaseFiller - Fill 31538695: created for report3

780 [main] DEBUG net.sf.jasperreports.engine.fill.JRBaseFiller - Fill 31538695: filling report

828 [main] DEBUG net.sf.jasperreports.engine.fill.JRBaseFiller - Fill 31538695: adding page 1

828 [main] DEBUG net.sf.jasperreports.engine.fill.JRVerticalFiller - Fill 31538695: title

828 [main] DEBUG net.sf.jasperreports.engine.fill.JRVerticalFiller - Fill 31538695: page header

828 [main] DEBUG net.sf.jasperreports.engine.fill.JRVerticalFiller - Fill 31538695: column header

828 [main] DEBUG net.sf.jasperreports.engine.fill.JRVerticalFiller - Fill 31538695: summary

828 [main] DEBUG net.sf.jasperreports.engine.fill.JRVerticalFiller - Fill 31538695: column footer

828 [main] DEBUG net.sf.jasperreports.engine.fill.JRVerticalFiller - Fill 31538695: page footer

828 [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

Sorry, the java code didn't paste very well - I've attached it here as code.

Thanks

James

Code:
	    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

 Hai

This is the problem due to the jasper report 3.6.2

please 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 do

copied 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 replay

thanks

Link to comment
Share on other sites

  Hai

This is the problem due to the jasper report 3.6.2

please 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 do

copied 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 replay

thanks

Link to comment
Share on other sites

Hi,

The same when done with irepor3.0.0

the 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 this
thanks
Link to comment
Share on other sites

  • 1 year later...

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 account

Sign in

Already have an account? Sign in here.

Sign In Now

×
×
  • Create New...