Hi,
I've created a simple project just to try out jasper report:
jasperreports-maven-plugin.As mentioned in
<http://mojo.codehaus.org/jasperreports-maven-plugin/compile-reports-mojo.html>
i have placed my sample.jrxml in Sample\webapp\src\main\jasperreports
My pom.xml looks like this(dependencies not copied here)
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>jasperreports-maven-plugin</artifactId>
<dependencies>
<dependency>
<groupId>com.domainlanguage</groupId>
<artifactId>timeandmoney</artifactId>
<version>0.5.1</version>
</dependency>
</dependencies>
<executions> <execution>
<goals> <goal>compile-reports</goal>
<parameter>additionalClasspath</parameter>
<expression>C:/Documents and
Settings/bibin.jacob/.m2/repository/com/domainlanguage/timeandmoney/0.5/timeandmoney-0.5.jar</expression>
</goals>
</execution>
</executions>
</plugin>
The problem is iam using a class com.domainlanguage.Money of timeandmoney.jar
for a conversion in my jrxml file(see the portion of jrxml file below). But
while compiling iam getting the error : package com.domainlanguage.* not found.
Iam importing the package in jrxml.When running through ireport(tool) it works
fine. What will be the solution?? why the additionalClasspath is not taking.Is
it the way to give additionalClasspath. If anybody knows the solution please
reply.
Portion of jrxml file
<?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="sample" columnCount="1" printOrder="Vertical"
orientation="Portrait" pageWidth="595" pageHeight="1000" 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.*" />
<import value="com.domainlanguage.*" />
<field name="filedBy.name" class="java.lang.String"/>
<field name="state.state" class="java.lang.String"/>
<field name="payment.claimedAmount" class="java.lang.Object"/>
<band height="39" isSplitAllowed="true" >
<crosstab >
<measure name="payment.claimedAmount_Count" class="java.math.BigDecimal"
calculation="Count">
<measureExpression><![CDATA[(BigDecimal)((com.domainlanguage.money.Money)$F{payment.claimedAmount}).breachEncapsulationOfAmount()]]></measureExpression>
</measure>
<measure name="payment.claimedAmount_Sum" class="java.math.BigDecimal"
calculation="Sum">
<measureExpression><![CDATA[(BigDecimal)((com.domainlanguage.money.Money)$F{payment.claimedAmount}).breachEncapsulationOfAmount()]]></measureExpression>
</measure>
---------------------------------
Heres a new way to find what you're looking for - Yahoo! Answers