I put *.jasper* file in my web content folder of my project and in my action class there is only execute method and my *struts.xml* has following code:
<!-- language: lang-xml -->
<action name="myJasperTest" class="com.acme.test.action.JasperAction">
<result name="success" type="jasper">
<param name="location">/our_jasper_template.jasper</param>
<param name="dataSource">myList</param>
<param name="reportParameters">reportParams</param>
<param name="format">PDF</param>
</result>
<result name="error">/Error.jsp</result>
</action>
And while running this program it gives me error:
java.lang.ClassCastException: cannot assign instance of
net.sf.jasperreports.engine.base.JRBaseStyle to field
net.sf.jasperreports.engine.base.JRBaseParagraph.paragraphContainer of type
net.sf.jasperreports.engine.JRParagraphContainer in instance of
net.sf.jasperreports.engine.base.JRBaseParagraph
Can anybody help me how to resolve this problem?
The Jar files in the projects lib folder should be matching the version of iReport
I had the same problem and it has been solved by using correct jar files.
you can take a look at the link below:
http://sourceforge.net/projects/jasperreports/files/jasperreports/