Granny's Programming Pearls
"inside of every large program is a small program struggling to get out"
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
  • Campbell Ritchie
  • Liutauras Vilda
  • Tim Cooke
  • Jeanne Boyarsky
  • Bear Bibeault
  • Knute Snortum
  • paul wheaton
  • Devaka Cooray
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Ron McLeod
  • Piet Souris
  • Ganesh Patekar
  • Tim Holloway
  • Carey Brown
  • salvin francis

exported Jasper Report has different look than preview in IReport designer

Posts: 10
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

I am using IReport 4 and Jasper Report 4 with Netbeans 6.8 in my application. I am able to successfully export the report to pdf form. But the exported report pdf doesn't have the look and feel of the report previwed in IReport designer. For example, the page number i,e, page 1 of 6 , doesn't show up in the exported pdf. Also, the lines that i am using after each row doesn't come up in the exported report.

I have attached both the files with this post. Also posting the XML source of the jasper report.:

<?xml version="1.0" encoding="UTF-8"?>
<jasperReport xmlns="" xmlns:xsi="" xsi:schemaLocation="" name="report name" pageWidth="595" pageHeight="842" columnWidth="555" leftMargin="20" rightMargin="20" topMargin="20" bottomMargin="20">
<property name="ireport.zoom" value="1.0"/>
<property name="ireport.x" value="0"/>
<property name="ireport.y" value="0"/>
applicant.`name` AS applicant_name,
applicant.`age` AS applicant_age
`applicant` applicant]]>
<field name="applicant_name" class="java.lang.String"/>
<field name="applicant_age" class="java.lang.Integer"/>
<band splitType="Stretch"/>
<band height="72" splitType="Stretch">
<reportElement mode="Opaque" x="220" y="31" width="179" height="21"/>
<font fontName="Times New Roman" size="18" isBold="true" isUnderline="false"/>
<text><![CDATA[ Test Report]]></text>
<reportElement x="173" y="57" width="226" height="1"/>
<band height="46" splitType="Stretch">
<reportElement x="433" y="19" width="80" height="20"/>
<textElement textAlignment="Right"/>
<textFieldExpression class="java.lang.String"><![CDATA["Page "+$V{PAGE_NUMBER}+" of"]]></textFieldExpression>
<textField evaluationTime="Report">
<reportElement x="513" y="19" width="40" height="20"/>
<textFieldExpression class="java.lang.String"><![CDATA[" " + $V{PAGE_NUMBER}]]></textFieldExpression>
<band height="24" splitType="Stretch">
<reportElement x="54" y="0" width="100" height="20"/>
<font size="14" isBold="true"/>
<reportElement x="399" y="0" width="100" height="20"/>
<font size="14" isBold="true"/>
<band height="58" splitType="Stretch">
<reportElement x="391" y="16" width="100" height="20"/>
<textFieldExpression class="java.lang.Integer"><![CDATA[$F{applicant_age}]]></textFieldExpression>
<reportElement x="54" y="16" width="100" height="20"/>
<textFieldExpression class="java.lang.String"><![CDATA[$F{applicant_name}]]></textFieldExpression>
<reportElement x="44" y="47" width="482" height="1"/>
<band height="45" splitType="Stretch"/>
<band height="54" splitType="Stretch">
<reportElement x="220" y="19" width="149" height="20"/>
<font size="12" isBold="true"/>
<band height="42" splitType="Stretch"/>

Any help will be appreciated.
[Thumbnail for exported-report.jpg]
exported report
[Thumbnail for ireport-preview.jpg]
ireport preview
Don't count your weasels before they've popped. And now for a mulberry bush related tiny ad:
Java file APIs (DOC, XLS, PDF, and many more)
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!