Jump to content

Exception in when loading jrxml


dspence

Recommended Posts

Hello,

 

I am trying to upgrade to iReport 1.2.5 and I am getting an exception when I try to load one of my reports created in iReport 0.5.2.

 

I think I have isolated the problem to the barcode.

 

The exception when loading the xml is

java.lang.StringIndexOutOfBoundsException: String index out of range: -1

 

Ideas?

 

Thanks,

Don Spence

 

 

Here is the jrxml:

 

Code:
<?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="Pick_Plan_v2"
columnCount="1"
printOrder="Vertical"
orientation="Landscape"
pageWidth="792"
pageHeight="612"
columnWidth="564"
columnSpacing="0"
leftMargin="18"
rightMargin="18"
topMargin="18"
bottomMargin="18"
whenNoDataType="NoPages"
isTitleNewPage="false"
isSummaryNewPage="false">
<property name="ireport.scriptlethandling" value="0" />
<property name="ireport.encoding" value="UTF-8" />
<import value="java.util.*" />
<import value="net.sf.jasperreports.engine.*" />
<import value="net.sf.jasperreports.engine.data.*" />
<reportFont name="Detail" isDefault="true" fontName="Verdana" size="10" isBold="false" isItalic="false" isUnderline="false" isStrikeThrough="false" pdfFontName="verdana.ttf" pdfEncoding="Cp1252" isPdfEmbedded="true"/>
<reportFont name="Column_Header" isDefault="false" fontName="Verdana" size="12" isBold="true" isItalic="false" isUnderline="false" isStrikeThrough="false" pdfFontName="verdana.ttf" pdfEncoding="Cp1252" isPdfEmbedded="true"/>
<reportFont name="Title" isDefault="false" fontName="Verdana" size="12" isBold="true" isItalic="false" isUnderline="false" isStrikeThrough="false" pdfFontName="verdana.ttf" pdfEncoding="Cp1252" isPdfEmbedded="true"/>
<reportFont name="Small_Detail" isDefault="false" fontName="Verdana" size="8" isBold="false" isItalic="false" isUnderline="false" isStrikeThrough="false" pdfFontName="verdana.ttf" pdfEncoding="Cp1252" isPdfEmbedded="true"/>
<queryString><![CDATA[sELECT pro_lname AS txtProLName,
pro_fname AS txtProFName,
(SELECT pro_lname + ', ' + pro_fname) AS txtProLastFirstName,
RePlace(RePlace(aty_notes, CHAR(10), '<br>'), CHAR(13), '') AS txtAtyNotes,
aty_name AS txtAtyName,
aty_code AS txtAtyCode,
reg_to_aty_qty AS intRayQty,
reg_code AS txtRegCode,
CONVERT(VARCHAR(20), reg_date_registered, 120) AS dteRegDateRegistered,
pro_addr_line1 AS txtProAdrLine1,
pro_addr_line2 AS txtProAdrLine2,
pro_addr_city AS txtProAdrCity,
pro_addr_state AS txtProAdrState,
pro_addr_postal_code AS txtProAdrPostalCode,
pro_addr_country AS txtProAdrCountry,
reg_id
FROM registrations_view
LEFT JOIN reg_answers ON (reg_ans_frn_reg_id = reg_id)
JOIN profiles_report_view ON (pro_id = reg_frn_pro_id)
LEFT JOIN events ON (evt_id = reg_frn_evt_id)
LEFT JOIN registration_activity_report_view ON (reg_to_aty_frn_reg_id = reg_id)
LEFT JOIN activities ON (aty_id = reg_to_aty_frn_aty_id)
WHERE reg_is_test = evt_is_test_mode
AND reg_frn_evt_id = 16
AND reg_is_active = 1
AND (reg_to_aty_is_active Is Null OR reg_to_aty_is_active = 1)
AND (aty_is_active Is Null OR aty_is_active = 1)
ORDER BY txtProLName ASC, txtAtyName ASC]]></queryString>
<group name="Registration" isStartNewColumn="false" isStartNewPage="true" isResetPageNumber="false" isReprintHeaderOnEachPage="true" minHeightToStartNewPage="0" >
<groupExpression><![CDATA[$F{reg_id}]]></groupExpression>
<groupHeader>
<band height="0" isSplitAllowed="true" >
</band>
</groupHeader>
<groupFooter>
<band height="20" isSplitAllowed="true" >
</band>
</groupFooter>
</group>
<background>
<band height="0" isSplitAllowed="true" >
</band>
</background>
<title>
<band height="0" isSplitAllowed="true" >
</band>
</title>
<pageHeader>
<band height="173" isSplitAllowed="true" >
<image scaleImage="RetainShape" vAlign="Top" hAlign="Left" isUsingCache="false" evaluationTime="Now" hyperlinkType="None" hyperlinkTarget="Self" >
<reportElement
mode="Transparent"
x="40"
y="51"
width="128"
height="21"
forecolor="#000000"
backcolor="#FFFFFF"
key="barRegCode1"
stretchType="NoStretch"
positionType="FixRelativeToTop"
isPrintRepeatedValues="true"
isRemoveLineWhenBlank="false"
isPrintInFirstWholeBand="false"
isPrintWhenDetailOverflows="false"/>
<box topBorder="None" topBorderColor="#000000" leftBorder="None" leftBorderColor="#000000" rightBorder="None" rightBorderColor="#000000" bottomBorder="None" bottomBorderColor="#000000"/>
<graphicElement stretchType="NoStretch" pen="None" fill="Solid" />
<imageExpression class="java.awt.Image"><![CDATA[it.businesslogic.ireport.barcode.BcImage.getBarcodeImage(4,$F{txtRegCode},true,false)]]></imageExpression>
</image>
</band>
</pageHeader>
<columnHeader>
<band height="15" isSplitAllowed="true" >
</band>
</columnHeader>
<detail>
<band height="19" isSplitAllowed="true" >
</band>
</detail>
<columnFooter>
<band height="0" isSplitAllowed="true" >
</band>
</columnFooter>
<pageFooter>
<band height="22" isSplitAllowed="true" >
</band>
</pageFooter>
<summary>
<band height="0" isSplitAllowed="true" >
</band>
</summary>
</jasperReport>
Link to comment
Share on other sites

  • Replies 2
  • Created
  • Last Reply

Top Posters In This Topic

Popular Days

Top Posters In This Topic

Hi Don,

 

basically this is a bug of iReport. A recent modification to parse complex barcode expression is now not compatible with old style barcode expression (which take 4 params, instead of the current 7.

 

The offending line is this one:

 

Code:
<imageExpression class="java.awt.Image"><![CDATA[it.businesslogic.ireport.barcode.BcImage.getBarcodeImage(4, $F{txtRegCode}, true, false)]]></imageExpression>

 

To quickly workaround the problem, you can add the other 3 parameters required:

 

Code:
[code]<imageExpression class="java.awt.Image"><![CDATA[it.businesslogic.ireport.barcode.BcImage.getBarcodeImage(4, $F{txtRegCode}, true, false,"",0,0)]]></imageExpression>

 

Giulio

Post edited by: giulio, at: 2006/09/07 06:46

Link to comment
Share on other sites

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...