phil2009 Posted March 12, 2009 Share Posted March 12, 2009 Hello all,I have created ireport with crosstab. It works fine when i compile it and run it with ireport. But when i upload the same jasper file to openreport. it shows error given below. Error loading object from file : /opt/tomcat/webapps/openreports/reports/OperatorWiseSalesReport_1.jasperI have attached the xml file of the report. Please correct me if i did something wrong. 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="OperatorWiseSalesReport_1" 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="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.*" /> <parameter name="fromDate" isForPrompting="true" class="java.util.Date"> <defaultValueExpression ><![CDATA[new java.util.Date()]]></defaultValueExpression> </parameter> <parameter name="toDate" isForPrompting="true" class="java.util.Date"> <defaultValueExpression ><![CDATA[new java.util.Date()]]></defaultValueExpression> </parameter> <queryString><![CDATA[select h.abbreviation as HotelName,r.id, ( select rc.crm_account_name from reservation_customer as rc where rc.id=r.customer_id ) as Operator, sum( ( rsd.initial_standard_amount + rsd.initial_adult_extra_amount + rsd.initial_child_extra_amount - rsd.discount_amount-rsd.package_discount - rsd.category_discount + rsd.season_supplement_amount )*r.exchange_rate ) as TotalAmount from reservation as r, room_stay as rs, hotel as h, rate_plan as rsd where r.hotel_id=h.id and rsd.room_stay_id=rs.id and r.re_confirmed_on is not null and r.deleted_on is NULL and rs.reservation_id =r.id and rs.check_out_date between $P{fromDate} and DATE_ADD($P{toDate},INTERVAL 86399 SECOND) and rs.status not like 'Deleted' group by r.id order by r.re_confirmed_on]]></queryString> <field name="HotelName" class="java.lang.String"/> <field name="id" class="java.lang.Long"/> <field name="Operator" class="java.lang.String"/> <field name="TotalAmount" class="java.math.BigDecimal"/> <background> <band height="0" isSplitAllowed="true" > </band> </background> <title> <band height="50" isSplitAllowed="true" > </band> </title> <pageHeader> <band height="0" isSplitAllowed="true" > </band> </pageHeader> <columnHeader> <band height="0" isSplitAllowed="true" > </band> </columnHeader> <detail> <band height="0" isSplitAllowed="true" > </band> </detail> <columnFooter> <band height="0" isSplitAllowed="true" > </band> </columnFooter> <pageFooter> <band height="0" isSplitAllowed="true" > </band> </pageFooter> <summary> <band height="50" isSplitAllowed="true" > <crosstab > <reportElement x="0" y="3" width="530" height="45" key="crosstab-1"/> <crosstabHeaderCell> <cellContents backcolor="#FFFFFF" mode="Transparent"> <box> <pen lineWidth="0.0" lineStyle="Solid"/> <topPen lineWidth="0.0" lineStyle="Solid"/> <leftPen lineWidth="0.0" lineStyle="Solid"/> <bottomPen lineWidth="0.0" lineStyle="Solid"/> <rightPen lineWidth="0.0" lineStyle="Solid"/></box> </cellContents> </crosstabHeaderCell> <rowGroup name="Operator" width="100" totalPosition="End"> <bucket> <bucketExpression class="java.lang.String"><![CDATA[$F{Operator}]]></bucketExpression> </bucket> <crosstabRowHeader> <cellContents mode="Transparent"> <box> <topPen lineWidth="1.0" lineStyle="Solid" lineColor="#000000"/> <leftPen lineWidth="1.0" lineStyle="Solid" lineColor="#000000"/> <bottomPen lineWidth="1.0" lineStyle="Solid" lineColor="#000000"/> <rightPen lineWidth="1.0" lineStyle="Solid" lineColor="#000000"/></box> <textField isStretchWithOverflow="false" isBlankWhenNull="false" evaluationTime="Now" hyperlinkType="None" hyperlinkTarget="Self" > <reportElement x="0" y="0" width="100" height="30" key="textField"/> <box></box> <textElement textAlignment="Center" verticalAlignment="Middle"> <font/> </textElement> <textFieldExpression class="java.lang.String"><![CDATA[$V{Operator}]]></textFieldExpression> </textField> </cellContents> </crosstabRowHeader> <crosstabTotalRowHeader> <cellContents mode="Transparent"> <box> <topPen lineWidth="1.0" lineStyle="Solid" lineColor="#000000"/> <leftPen lineWidth="1.0" lineStyle="Solid" lineColor="#000000"/> <bottomPen lineWidth="1.0" lineStyle="Solid" lineColor="#000000"/> <rightPen lineWidth="1.0" lineStyle="Solid" lineColor="#000000"/></box> <textField isStretchWithOverflow="false" isBlankWhenNull="false" evaluationTime="Now" hyperlinkType="None" hyperlinkTarget="Self" > <reportElement x="0" y="0" width="100" height="30" key="textField"/> <box></box> <textElement textAlignment="Center" verticalAlignment="Middle"> <font/> </textElement> <textFieldExpression class="java.lang.String"><![CDATA["Operator total"]]></textFieldExpression> </textField> </cellContents> </crosstabTotalRowHeader> </rowGroup> <columnGroup name="HotelName" height="25" totalPosition="End" headerPosition="Center"> <bucket> <bucketExpression class="java.lang.String"><![CDATA[$F{HotelName}]]></bucketExpression> </bucket> <crosstabColumnHeader> <cellContents mode="Transparent"> <box> <pen lineWidth="0.0" lineStyle="Solid"/> <topPen lineWidth="0.0" lineStyle="Solid"/> <leftPen lineWidth="0.0" lineStyle="Solid"/> <bottomPen lineWidth="0.0" lineStyle="Solid"/> <rightPen lineWidth="0.0" lineStyle="Solid"/></box> <textField isStretchWithOverflow="false" isBlankWhenNull="false" evaluationTime="Now" hyperlinkType="None" hyperlinkTarget="Self" > <reportElement x="0" y="0" width="70" height="25" key="textField"/> <box></box> <textElement textAlignment="Center" verticalAlignment="Middle"> <font/> </textElement> <textFieldExpression class="java.lang.String"><![CDATA[$V{HotelName}]]></textFieldExpression> </textField> <line direction="TopDown"> <reportElement x="0" y="1" width="0" height="24" key="line-1"/> <graphicElement stretchType="NoStretch"/> </line> <line direction="TopDown"> <reportElement x="0" y="0" width="70" height="0" key="line-1"/> <graphicElement stretchType="NoStretch"/> </line> </cellContents> </crosstabColumnHeader> <crosstabTotalColumnHeader> <cellContents mode="Transparent"> <box> <topPen lineWidth="1.0" lineStyle="Solid" lineColor="#000000"/> <leftPen lineWidth="1.0" lineStyle="Solid" lineColor="#000000"/> <bottomPen lineWidth="1.0" lineStyle="Solid" lineColor="#000000"/> <rightPen lineWidth="1.0" lineStyle="Solid" lineColor="#000000"/></box> <textField isStretchWithOverflow="false" isBlankWhenNull="false" evaluationTime="Now" hyperlinkType="None" hyperlinkTarget="Self" > <reportElement x="0" y="0" width="82" height="25" key="textField"/> <box></box> <textElement textAlignment="Center" verticalAlignment="Middle"> <font/> </textElement> <textFieldExpression class="java.lang.String"><![CDATA["HotelName total"]]></textFieldExpression> </textField> </cellContents> </crosstabTotalColumnHeader> </columnGroup> <measure name="TotalAmount_Sum" class="java.math.BigDecimal" calculation="Sum"> <measureExpression><![CDATA[$F{TotalAmount}]]></measureExpression> </measure> <crosstabCell width="71" height="30"> <cellContents mode="Transparent"> <box> <topPen lineWidth="1.0" lineStyle="Solid" lineColor="#000000"/> <leftPen lineWidth="1.0" lineStyle="Solid" lineColor="#000000"/> <bottomPen lineWidth="1.0" lineStyle="Solid" lineColor="#000000"/> <rightPen lineWidth="1.0" lineStyle="Solid" lineColor="#000000"/></box> <textField isStretchWithOverflow="false" pattern="#,##0.00" isBlankWhenNull="false" evaluationTime="Now" hyperlinkType="None" hyperlinkTarget="Self" > <reportElement x="0" y="0" width="70" height="30" key="textField"/> <box></box> <textElement textAlignment="Center" verticalAlignment="Middle"> <font size="8"/> </textElement> <textFieldExpression class="java.math.BigDecimal"><![CDATA[$V{TotalAmount_Sum}]]></textFieldExpression> </textField> </cellContents> </crosstabCell> <crosstabCell width="83" height="30" columnTotalGroup="HotelName"> <cellContents mode="Transparent"> <box> <topPen lineWidth="1.0" lineStyle="Solid" lineColor="#000000"/> <leftPen lineWidth="1.0" lineStyle="Solid" lineColor="#000000"/> <bottomPen lineWidth="1.0" lineStyle="Solid" lineColor="#000000"/> <rightPen lineWidth="1.0" lineStyle="Solid" lineColor="#000000"/></box> <textField isStretchWithOverflow="false" pattern="#,##0.00" isBlankWhenNull="false" evaluationTime="Now" hyperlinkType="None" hyperlinkTarget="Self" > <reportElement x="0" y="0" width="82" height="30" key="textField"/> <box></box> <textElement textAlignment="Center" verticalAlignment="Middle"> <font size="8"/> </textElement> <textFieldExpression class="java.math.BigDecimal"><![CDATA[$V{TotalAmount_Sum}]]></textFieldExpression> </textField> </cellContents> </crosstabCell> <crosstabCell width="71" height="30" rowTotalGroup="Operator"> <cellContents mode="Transparent"> <box> <topPen lineWidth="1.0" lineStyle="Solid" lineColor="#000000"/> <leftPen lineWidth="1.0" lineStyle="Solid" lineColor="#000000"/> <bottomPen lineWidth="1.0" lineStyle="Solid" lineColor="#000000"/> <rightPen lineWidth="1.0" lineStyle="Solid" lineColor="#000000"/></box> <textField isStretchWithOverflow="false" pattern="#,##0.00" isBlankWhenNull="false" evaluationTime="Now" hyperlinkType="None" hyperlinkTarget="Self" > <reportElement x="0" y="0" width="70" height="30" key="textField"/> <box></box> <textElement textAlignment="Center" verticalAlignment="Middle"> <font size="8"/> </textElement> <textFieldExpression class="java.math.BigDecimal"><![CDATA[$V{TotalAmount_Sum}]]></textFieldExpression> </textField> </cellContents> </crosstabCell> <crosstabCell width="83" height="30" rowTotalGroup="Operator" columnTotalGroup="HotelName"> <cellContents mode="Transparent"> <box> <topPen lineWidth="1.0" lineStyle="Solid" lineColor="#000000"/> <leftPen lineWidth="1.0" lineStyle="Solid" lineColor="#000000"/> <bottomPen lineWidth="1.0" lineStyle="Solid" lineColor="#000000"/> <rightPen lineWidth="1.0" lineStyle="Solid" lineColor="#000000"/></box> <textField isStretchWithOverflow="false" pattern="#,##0.00" isBlankWhenNull="false" evaluationTime="Now" hyperlinkType="None" hyperlinkTarget="Self" > <reportElement x="0" y="0" width="82" height="30" key="textField"/> <box></box> <textElement textAlignment="Center" verticalAlignment="Middle"> <font size="8"/> </textElement> <textFieldExpression class="java.math.BigDecimal"><![CDATA[$V{TotalAmount_Sum}]]></textFieldExpression> </textField> </cellContents> </crosstabCell> <whenNoDataCell> <cellContents mode="Transparent"> <box></box> </cellContents> </whenNoDataCell> </crosstab> </band> </summary></jasperReport> 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