Struts & Jasper Report
i wanna use jasperreport in my web application to print a report.i am using struts framework in my app.pls help me.how will i do it that reporting in my web app?
my sample code is working in only server side. What should i do to work in client side for printing a report?
----My Codes--------
public class denemeaction extends Action {
private JasperReport jasperReport;
private JasperPrint jasperPrint;
private Object out;
public denemeaction() {
public ActionForward execute(ActionMapping mapping,
ActionForm form,
HttpServletRequest request,
HttpServletResponse response)
throws Exception{
denemeform dform=(denemeform)form;
File reportFile = new File("C:/omer.jasper");
if (!reportFile.exists())
throw new JRRuntimeException("File x.jasper not found. The report design must be compiled first.");
JasperReport jasperReport = (JasperReport)JRLoader.loadObject(reportFile.getPath());
JasperPrint jasperPrint =JasperFillManager.fillReport(jasperReport, new HashMap(),new JREmptyDataSource());
JasperPrintManager.printReport(jasperPrint,false);
return mapping.getInputForward();
Thanks ..
Finally i found a way to add image to jasper report. It is pretty simple, just give the exact image location to the image expression. In your web application, the image location may vary so, dynamically set the image location from your model class. Also, make sure that your lib folder contains itext-1.3.1.jar. If your lib folder contains itext-1.3.1.jar and iText-2.1.3.jar u will get like: java.lang.NoSuchMethodError: com.lowagie.text.Image.plainWidth()F
So remove the iText-2.1.3.jar and keep only itext-1.3.1.jar, try this will work
Similar Messages
-
Add Image to Jasper Report with Struts 2 and Hibernate
Hi I want to add image to jasper report[pdf] in the environment of Struts 2 framework and hibernate. I am trying
this for last couple of days, but i am unable to get the work done. if any body know the steps to add image to
jasper reports, please help me or if u have any tutorials please let me know. I am using iReport-nb-3.5.0 to generate jasper files.
Thanks in advanceFinally i found a way to add image to jasper report. It is pretty simple, just give the exact image location to the image expression. In your web application, the image location may vary so, dynamically set the image location from your model class. Also, make sure that your lib folder contains itext-1.3.1.jar. If your lib folder contains itext-1.3.1.jar and iText-2.1.3.jar u will get like: java.lang.NoSuchMethodError: com.lowagie.text.Image.plainWidth()F
So remove the iText-2.1.3.jar and keep only itext-1.3.1.jar, try this will work -
Jasper Reports in Linux vs Jasper Reports in Windows
Dear Sirs...
an application is developed using jdeveloper 10.1.2 (struts with UIX technology) and used Jasper report to generated PDF and HTML reports programmatically (no XML files for reports tamplates are used).
in jdeveloper PDF reports are generated without problem,
i create a WAR file and deploy it to oracle application server R2 under windows, it works just fine.
that same WAR file is deployed into linux (again oracle application server R2), this time an exception occurs,
i only selected two jar files (jasperreports.jar and itext.jar) to be included into the war file.
now can any one explain to me why it runs perfectly fine in windows AS and not linux AS???? aren't both of them use the same java virtual machine????
any advice please???
best regardssorry i forget to post the error in linux, the log contains the following:
net.sf.jasperreports.engine.JRException: Error
compiling report java source files :
/home/oracle/OraHome/j2ee/home/EasyJasperDesign_1192848437309_635467.java
best regards -
Error when compiling jasper report on Linux
Hey guys/gals :)
I'm having trouble creating a jasper report on Linux. I'm getting the ff. error after i click the
link to generate my report:
Http status 500:
exception:
javax.servlet.ServletException: Servlet execution threw an exception
root cause:
java.lang.NoClassDefFoundError
net.sf.jasperreports.engine.xml.JRBaseFactory.getColor(JRBaseFactory.java:90)
net.sf.jasperreports.engine.xml.JRElementFactory.createObject(JRElementFactory.java:161)
org.apache.commons.digester.FactoryCreateRule.begin(FactoryCreateRule.java:389)
org.apache.commons.digester.Digester.startElement(Digester.java:1361)
org.apache.xerces.parsers.AbstractSAXParser.startElement(Unknown Source)
org.apache.xerces.parsers.AbstractXMLDocumentParser.emptyElement(Unknown Source)
org.apache.xerces.impl.dtd.XMLDTDValidator.emptyElement(Unknown Source)
org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanStartElement(Unknown Source)
org.apache.xerces.impl.XMLDocumentFragmentScannerImpl$FragmentContentDispatcher.dispatch(Unknown Source)
org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown Source)
org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
org.apache.xerces.parsers.XMLParser.parse(Unknown Source)
org.apache.xerces.parsers.AbstractSAXParser.parse(Unknown Source)
org.apache.commons.digester.Digester.parse(Digester.java:1647)
net.sf.jasperreports.engine.xml.JRXmlLoader.loadXML(JRXmlLoader.java:238)
net.sf.jasperreports.engine.xml.JRXmlLoader.loadXML(JRXmlLoader.java:225)
net.sf.jasperreports.engine.xml.JRXmlLoader.load(JRXmlLoader.java:213)
net.sf.jasperreports.engine.JasperCompileManager.compileReport(JasperCompileManager.java:195)
com.bdo.clg.mrs.main.utils.ReportUtil.printUpldTxn(ReportUtil.java:112)
com.bdo.clg.mrs.inquiry.action.PrintUpldTxnAction.execute(PrintUpldTxnAction.java:48)
org.apache.struts.action.RequestProcessor.processActionPerform(RequestProcessor.java:446)
org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:266)
org.apache.struts.action.ActionServlet.process(ActionServlet.java:1292)
org.apache.struts.action.ActionServlet.doGet(ActionServlet.java:492)
javax.servlet.http.HttpServlet.service(HttpServlet.java:689)
javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
Background:
I got a web application (java 1.4.2,Struts ) contained in Tomcat 5.0 server running on a Linux OS ver. 2.6.8.
The application works fine except when generating a report. It seems that the error is thrown during compilation
of the jasper template as suggested from the line ....JasperCompileManager.compileReport(JasperCompileManager.java:195) listed
above . I'm able to build the reports on Win 2K though.
What else needs to be done on the Linux side? All i've done so far is to set the path for java in the env. variables.
Have checked out varous sites/forums for solutions but so far still no luck. Your suggestions or assistance will be greatly appreciated.To solve this issue, start your java environment with the option -Djava.awt.headless=true.
It solves the issue... if you google for "Linux"+"JasperReports"+"NoClassDefFoundError" you will find the background info on this issue.
Thx,
Rob -
I have tried to implement jasper report but getting exceptions at run time
I have tried to implement jasper report but getting exceptions at run time and I couldn't get the reason of these exceptions. please give me idea to solve this problem.
I am using following jar files for this :
commons-beanutils-1.6.1.jar
commons-digester-1.7.jar
commons-logging.jar
jasperreports-1.2.0.jar
code is as follows:-
(1) xml:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE jasperReport
PUBLIC "-//JasperReports//DTD Report Design//EN"
"http://jasperreports.sourceforge.net/dtds/jasperreport.dtd">
<jasperReport name="Simple_Report">
<detail>
<band height="20">
<staticText>
<reportElement x="180" y="0" width="200" height="20"/>
<text><![CDATA[Hello World!]]></text>
</staticText>
</band>
</detail>
</jasperReport>
(2.) java file
import net.sf.jasperreports.engine.*;
import net.sf.jasperreports.engine.xml.*;
import org.xml.sax.*;
import org.apache.commons.digester.Digester;
import org.apache.commons.digester.RuleSetBase;
import java.util.*;
public class JasperReportsIntro
public static void main(String[] args)
JasperReport jasperReport;
JasperPrint jasperPrint;
try
jasperReport = JasperCompileManager.compileReport(
"jasperreports_demo.jrxml");
jasperPrint = JasperFillManager.fillReport(
jasperReport, new HashMap(), new JREmptyDataSource());
// JasperExportManager.exportReportToPdfFile(
// jasperPrint, "jasperReports/simple_report.pdf");
catch (JRException e)
e.printStackTrace();
I am getting exceptions like:
net.sf.jasperreports.engine.JRException: Errors were encountered when compiling report expressions class file:
/home/navneet/Simple_Report_1143636234024_954843.java:4: package net.sf.jasperreports.engine does not exist
import net.sf.jasperreports.engine.*;
^
/home/navneet/Simple_Report_1143636234024_954843.java:5: package net.sf.jasperreports.engine.fill does not exist
import net.sf.jasperreports.engine.fill.*;
^
/home/navneet/Simple_Report_1143636234024_954843.java:18: cannot find symbol
symbol: class JREvaluator
public class Simple_Report_1143636234024_954843 extends JREvaluator
^
/home/navneet/Simple_Report_1143636234024_954843.java:25: cannot find symbol
symbol : class JRFillParameter
location: class Simple_Report_1143636234024_954843
private JRFillParameter parameter_REPORT_RESOURCE_BUNDLE = null;
^
/home/navneet/Simple_Report_1143636234024_954843.java:26: cannot find symbol
symbol : class JRFillParameter
location: class Simple_Report_1143636234024_954843
private JRFillParameter parameter_REPORT_CONNECTION = null;
^
/home/navneet/Simple_Report_1143636234024_954843.java:27: cannot find symbol
symbol : class JRFillParameter
location: class Simple_Report_1143636234024_954843
private JRFillParameter parameter_REPORT_PARAMETERS_MAP = null;
^
/home/navneet/Simple_Report_1143636234024_954843.java:28: cannot find symbol
symbol : class JRFillParameter
location: class Simple_Report_1143636234024_954843
private JRFillParameter parameter_IS_IGNORE_PAGINATION = null;
^
/home/navneet/Simple_Report_1143636234024_954843.java:29: cannot find symbol
symbol : class JRFillParameter
location: class Simple_Report_1143636234024_954843
private JRFillParameter parameter_REPORT_CLASS_LOADER = null;
^
/home/navneet/Simple_Report_1143636234024_954843.java:30: cannot find symbol
symbol : class JRFillParameter
location: class Simple_Report_1143636234024_954843
private JRFillParameter parameter_REPORT_VIRTUALIZER = null;
^
/home/navneet/Simple_Report_1143636234024_954843.java:31: cannot find symbol
symbol : class JRFillParameter
location: class Simple_Report_1143636234024_954843
private JRFillParameter parameter_REPORT_LOCALE = null;
^
/home/navneet/Simple_Report_1143636234024_954843.java:32: cannot find symbol
symbol : class JRFillParameter
location: class Simple_Report_1143636234024_954843
private JRFillParameter parameter_REPORT_DATA_SOURCE = null;
^
/home/navneet/Simple_Report_1143636234024_954843.java:33: cannot find symbol
symbol : class JRFillParameter
location: class Simple_Report_1143636234024_954843
private JRFillParameter parameter_REPORT_SCRIPTLET = null;
^
/home/navneet/Simple_Report_1143636234024_954843.java:34: cannot find symbol
symbol : class JRFillParameter
location: class Simple_Report_1143636234024_954843
private JRFillParameter parameter_REPORT_MAX_COUNT = null;
^
/home/navneet/Simple_Report_1143636234024_954843.java:35: cannot find symbol
symbol : class JRFillVariable
location: class Simple_Report_1143636234024_954843
private JRFillVariable variable_PAGE_NUMBER = null;
^
/home/navneet/Simple_Report_1143636234024_954843.java:36: cannot find symbol
symbol : class JRFillVariable
location: class Simple_Report_1143636234024_954843
private JRFillVariable variable_COLUMN_NUMBER = null;
^
/home/navneet/Simple_Report_1143636234024_954843.java:37: cannot find symbol
symbol : class JRFillVariable
location: class Simple_Report_1143636234024_954843
private JRFillVariable variable_REPORT_COUNT = null;
^
/home/navneet/Simple_Report_1143636234024_954843.java:38: cannot find symbol
symbol : class JRFillVariable
location: class Simple_Report_1143636234024_954843
private JRFillVariable variable_PAGE_COUNT = null;
^
/home/navneet/Simple_Report_1143636234024_954843.java:39: cannot find symbol
symbol : class JRFillVariable
location: class Simple_Report_1143636234024_954843
private JRFillVariable variable_COLUMN_COUNT = null;
^
/home/navneet/Simple_Report_1143636234024_954843.java:62: cannot find symbol
symbol : class JRFillParameter
location: class Simple_Report_1143636234024_954843
parameter_REPORT_RESOURCE_BUNDLE = (JRFillParameter)pm.get("REPORT_RESOURCE_BUNDLE");
^
/home/navneet/Simple_Report_1143636234024_954843.java:63: cannot find symbol
symbol : class JRFillParameter
location: class Simple_Report_1143636234024_954843
parameter_REPORT_CONNECTION = (JRFillParameter)pm.get("REPORT_CONNECTION");
^
/home/navneet/Simple_Report_1143636234024_954843.java:64: cannot find symbol
symbol : class JRFillParameter
location: class Simple_Report_1143636234024_954843
parameter_REPORT_PARAMETERS_MAP = (JRFillParameter)pm.get("REPORT_PARAMETERS_MAP");
^
/home/navneet/Simple_Report_1143636234024_954843.java:65: cannot find symbol
symbol : class JRFillParameter
location: class Simple_Report_1143636234024_954843
parameter_IS_IGNORE_PAGINATION = (JRFillParameter)pm.get("IS_IGNORE_PAGINATION");
^
/home/navneet/Simple_Report_1143636234024_954843.java:66: cannot find symbol
symbol : class JRFillParameter
location: class Simple_Report_1143636234024_954843
parameter_REPORT_CLASS_LOADER = (JRFillParameter)pm.get("REPORT_CLASS_LOADER");
^
/home/navneet/Simple_Report_1143636234024_954843.java:67: cannot find symbol
symbol : class JRFillParameter
location: class Simple_Report_1143636234024_954843
parameter_REPORT_VIRTUALIZER = (JRFillParameter)pm.get("REPORT_VIRTUALIZER");
^
/home/navneet/Simple_Report_1143636234024_954843.java:68: cannot find symbol
symbol : class JRFillParameter
location: class Simple_Report_1143636234024_954843
parameter_REPORT_LOCALE = (JRFillParameter)pm.get("REPORT_LOCALE");
^
/home/navneet/Simple_Report_1143636234024_954843.java:69: cannot find symbol
symbol : class JRFillParameter
location: class Simple_Report_1143636234024_954843
parameter_REPORT_DATA_SOURCE = (JRFillParameter)pm.get("REPORT_DATA_SOURCE");
^
/home/navneet/Simple_Report_1143636234024_954843.java:70: cannot find symbol
symbol : class JRFillParameter
location: class Simple_Report_1143636234024_954843
parameter_REPORT_SCRIPTLET = (JRFillParameter)pm.get("REPORT_SCRIPTLET");
^
/home/navneet/Simple_Report_1143636234024_954843.java:71: cannot find symbol
symbol : class JRFillParameter
location: class Simple_Report_1143636234024_954843
parameter_REPORT_MAX_COUNT = (JRFillParameter)pm.get("REPORT_MAX_COUNT");
^
/home/navneet/Simple_Report_1143636234024_954843.java:88: cannot find symbol
symbol : class JRFillVariable
location: class Simple_Report_1143636234024_954843
variable_PAGE_NUMBER = (JRFillVariable)vm.get("PAGE_NUMBER");
^
/home/navneet/Simple_Report_1143636234024_954843.java:89: cannot find symbol
symbol : class JRFillVariable
location: class Simple_Report_1143636234024_954843
variable_COLUMN_NUMBER = (JRFillVariable)vm.get("COLUMN_NUMBER");
^
/home/navneet/Simple_Report_1143636234024_954843.java:90: cannot find symbol
symbol : class JRFillVariable
location: class Simple_Report_1143636234024_954843
variable_REPORT_COUNT = (JRFillVariable)vm.get("REPORT_COUNT");
^
/home/navneet/Simple_Report_1143636234024_954843.java:91: cannot find symbol
symbol : class JRFillVariable
location: class Simple_Report_1143636234024_954843
variable_PAGE_COUNT = (JRFillVariable)vm.get("PAGE_COUNT");
^
/home/navneet/Simple_Report_1143636234024_954843.java:92: cannot find symbol
symbol : class JRFillVariable
location: class Simple_Report_1143636234024_954843
variable_COLUMN_COUNT = (JRFillVariable)vm.get("COLUMN_COUNT");
^
33 errors
at net.sf.jasperreports.engine.design.JRAbstractCompiler.compileReport(JRAbstractCompiler.java:193)
at net.sf.jasperreports.engine.design.JRDefaultCompiler.compileReport(JRDefaultCompiler.java:131)
at net.sf.jasperreports.engine.JasperCompileManager.compileReport(JasperCompileManager.java:211)
at net.sf.jasperreports.engine.JasperCompileManager.compileReport(JasperCompileManager.java:144)
at com.appnetix.app.portal.financials.reports.RoyaltyReportAction.execute(RoyaltyReportAction.java:68)
at org.apache.struts.action.RequestProcessor.processActionPerform(RequestProcessor.java:484)
at com.appnetix.app.control.web.AppnetixRequestProcessor.process(AppnetixRequestProcessor.java:149)
at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1482)
at com.appnetix.app.control.web.AppnetixControllerServlet.doPost(AppnetixControllerServlet.java:262)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:763)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:856)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:237)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:157)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:214)
at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:104)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520)
at org.apache.catalina.core.StandardContextValve.invokeInternal(StandardContextValve.java:198)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:152)
at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:104)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:137)
at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:104)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:118)
at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:102)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:104)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:929)
at org.apache.coyote.tomcat5.CoyoteAdapter.service(CoyoteAdapter.java:160)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:799)
at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(Http11Protocol.java:705)
at org.apache.tomcat.util.net.TcpWorkerThread.runIt(PoolTcpEndpoint.java:577)
at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:683)
at java.lang.Thread.run(Thread.java:595)You have no permission to create a report. You have to create a permisson-entry into your server.policy. Then it would be work.
-
Open Jasper Report on IE Browser
Hi,
I have used the following code techniques to open the Jasper Report on IE Browser.But It is not opened on IE,But opened on seperate form window.
Frame Work: Struts 1.1
<%
// geting jasper print object from Action Class
JasperPrint print= (JasperPrint)request.getAttribute("jasperprint");
//view the jasper report using JasperViewer class with viewReport method
JasperViewer.viewReport(print,false);
%>
It is worked properly .But I want to display this report on IE Browser.
any one know this ,Please help me.Hi,
I have used the following code techniques to open the Jasper Report on IE Browser.But It is not opened on IE,But opened on seperate form window.
Frame Work: Struts 1.1
<%
// geting jasper print object from Action Class
JasperPrint print= (JasperPrint)request.getAttribute("jasperprint");
//view the jasper report using JasperViewer class with viewReport method
JasperViewer.viewReport(print,false);
%>
It is worked properly .But I want to display this report on IE Browser.
any one know this ,Please help me. -
Jasper Report Problem: No ClassDefError
Here is the exception I bumped into when I tried to call my servlet using jasper. I have deployed my app as a WAR file including the necessary jasper jar files. I dont know why it cant find the class when I already included the jar files with it. I appreciate any help. Do i miss out anything here? Thanks a lot.
java.lang.NoClassDefFoundError
at sun.misc.Unsafe.ensureClassInitialized(Native Method)
at sun.reflect.UnsafeFieldAccessorFactory.newFieldAccessor(UnsafeFieldAccessorFactory.java:20)
at sun.reflect.ReflectionFactory.newFieldAccessor(ReflectionFactory.java:122)
at java.lang.reflect.Field.acquireFieldAccessor(Field.java:779)
at java.lang.reflect.Field.getFieldAccessor(Field.java:760)
at java.lang.reflect.Field.getLong(Field.java:398)
at java.io.ObjectStreamClass.getDeclaredSUID(ObjectStreamClass.java:1478)
at java.io.ObjectStreamClass.access$400(ObjectStreamClass.java:47)
at java.io.ObjectStreamClass$3.run(ObjectStreamClass.java:335)
at java.security.AccessController.doPrivileged(Native Method)
at java.io.ObjectStreamClass.(ObjectStreamClass.java:333)
at java.io.ObjectStreamClass.lookup(ObjectStreamClass.java:253)
at java.io.ObjectStreamClass.initNonProxy(ObjectStreamClass.java:453)
at java.io.ObjectInputStream.readNonProxyDesc(ObjectInputStream.java:1521)
at java.io.ObjectInputStream.readClassDesc(ObjectInputStream.java:1435)
at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1626)
at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1274)
at java.io.ObjectInputStream.defaultReadFields(ObjectInputStream.java:1845)
at java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:1769)
at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1646)
at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1274)
at java.io.ObjectInputStream.readObject(ObjectInputStream.java:324)
at java.util.ArrayList.readObject(ArrayList.java:547)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:324)
at java.io.ObjectStreamClass.invokeReadObject(ObjectStreamClass.java:838)
at java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:1746)
at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1646)
at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1274)
at java.io.ObjectInputStream.defaultReadFields(ObjectInputStream.java:1845)
at java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:1769)
at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1646)
at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1274)
at java.io.ObjectInputStream.defaultReadFields(ObjectInputStream.java:1845)
at java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:1769)
at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1646)
at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1274)
at java.io.ObjectInputStream.readObject(ObjectInputStream.java:324)
at dori.jasper.engine.util.JRLoader.loadObject(JRLoader.java:128)
at dori.jasper.engine.JasperFillManager.fillReport(JasperFillManager.java:288)
at com.pejman.workspace.hrm.payroll.control.struts.PayrollReportAction.execute(PayrollReportAction.java:401)
at org.apache.struts.action.RequestProcessor.processActionPerform(RequestProcessor.java:484)
at org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:274)
at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1482)
at org.apache.struts.action.ActionServlet.doGet(ActionServlet.java:507)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:740)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:247)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:193)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:256)
at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
at org.apache.catalina.core.StandardContext.invoke(StandardContext.java:2416)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:180)
at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
at org.apache.catalina.valves.ErrorDispatcherValve.invoke(ErrorDispatcherValve.java:171)
at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:641)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:172)
at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:641)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:174)
at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
at org.apache.coyote.tomcat4.CoyoteAdapter.service(CoyoteAdapter.java:223)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:601)
at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(Http11Protocol.java:392)
at org.apache.tomcat.util.net.TcpWorkerThread.runIt(PoolTcpEndpoint.java:565)
at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:619)
at java.lang.Thread.run(Thread.java:534)Hi nanzee.
The problem u posted above looks similar to the one i'm facing now. I'm also getting a No ClassDefError when creating a jasper report on Linux. It works just fine on Windows 2k though.
I was hoping if u can share more specific details on how you managed to solve this problem. Your solution just might work for me.
Please shed more light on the ff:
1. "It has something to do with my missing fc3 linux libraries so i did an rpm for the deprecated libraries " -- how is this done? I'm not that versed in Linux. ( Our company requires us to use Linux ...)
2. "plus set something on my tomcat CATALINA_OPT portion "
Thank in advance and hope to hear from you nanzee. -
Open Jasper Report in new page using servlet
Guys,
Looks very simple but i am having problem making this process work. I am using 11.1.1.4
This is my use case:
- From a employee page, user clicks on a menu item to open report for current employee. I need to pass appropriate report parameters to servlet and open report into new page.
I can successfully call servlet using commandmenuitem and set request parameters and call servlet from backing bean.... but that doesn't open report in a new page.... any way i can do this?
Another option i tried was that using gomenuitem and setting target=blank but in that case i need to pass the parameter using servlet url which i like to avoid.(in case i need to pass many parameters in future) (also values will be set on page so i need to generate url when then click the menuitem...... so there are some hoops and loops i need to go through) I don't know a way to pass the request parameter using backing bean to servlet... i don't think it is possible.
Those are the two approaches i tried.
If you have any better approach...I would appreciate if you can let me know. (i have searched on internet for two days now.... for the solution)
-R
Edited by: polo on Dec 13, 2011 7:22 AMHi,
Hope following will useful
http://sameh-nassar.blogspot.com/2009/10/using-jasper-reports-with-jdeveloper.html
http://www.gebs.ro/blog/oracle/jasper-reports-in-adf/ -
Jasper report on HTML when one image loaded from database and for the other
How to generate jasper report on HTML when one image loaded from database and for the other we give a image path
My code
ByteArrayOutputStream baos = new ByteArrayOutputStream();
exporter = new JRHtmlExporter();
exporter.setParameter(JRExporterParameter.JASPER_PRINT, print);
exporter.setParameter(JRExporterParameter.OUTPUT_STREAM, baos);
exporter.setParameter(JRHtmlExporterParameter.IMAGES_URI, strImageInputDirectory);
exporter.setParameter(JRHtmlExporterParameter.IMAGES_DIR_NAME, strImageOutputPath == null ? "." : strImageOutputPath);
exporter.setParameter(JRHtmlExporterParameter.IS_OUTPUT_IMAGES_TO_DIR, Boolean.TRUE);
exporter.setParameter(JRHtmlExporterParameter.IS_USING_IMAGES_TO_ALIGN, Boolean.FALSE);
exporter.setParameter(JRHtmlExporterParameter.IS_WHITE_PAGE_BACKGROUND, Boolean.FALSE);
exporter.exportReport();
byte[] bdata = ((ByteArrayOutputStream) baos).toByteArray();
Can any one help pls
Message was edited by:
ameet.auhey sorry for posting it in this forum.
but do u have sample code for making it work.. since i am able to do it on PDF format(image from Database and another stored in the webserver) using
byte image[] =(byte[]) outData.get("image");
ByteArrayInputStream img = new ByteArrayInputStream(image);
hmimg.put("P_PARAMV3", img);
print = JasperFillManager.fillReport(reportFileName, hmimg, jrxmlds);
bdata= JasperExportManager.exportReportToPdf(print); -
How to generate jasper report in pdf format using swing
hi all,
im new to swing and jasper.. can anybody provide me some example on how to generate the jasper report in pdf format? i will call the reportManager from sessionBean.. below is my code:
1)delegate:
public GenerateReportDto generateIntoPdfReport(String fileName, String outputFileName, Map parameters){
GenerateReportDto generateReportDto = getAuditTrailServiceRemote().generateIntoPdfReport(fileName, outputFileName, parameters);
return generateReportDto;
2)sessionBean:
public GenerateReportDto generateIntoPdfReport(String fileName, String outputFileName, Map parameters){
//Map parameters = new HashMap();
ReportManager reportManager = new ReportManager();
3)ReportManager()
public void generateIntoPdfReport(String fileName, String outputFileName, Map parameters) {
Connection conn = null;
try {
conn = dataSource.getConnection();
//Generate the report to bytes
File reportFile = new File(fileName);
byte[] bytes =
JasperRunManager.runReportToPdf(
reportFile.getPath(),
parameters,
conn
//conn.close();
//Write the bytes to a file
ByteBuffer buf = ByteBuffer.wrap(bytes);
File file = new File(outputFileName);
// (if the file exists)
boolean append = false;
// Create a writable file channel
FileChannel wChannel = new FileOutputStream(file, append).getChannel();
// Write the ByteBuffer contents; the bytes between the ByteBuffer's
// position and the limit is written to the file
wChannel.write(buf);
// Close the file
wChannel.close();
} finally {
if (conn != null) {
conn.close();
Any help would be highly appreciated. Thanks in advanceHi ,
One 'simple' way is by using the DBMS_SCHEDULER db package and the procedure CREATE_JOB(....) using as job_type the value 'EXECUTABLE'...
Read for further info in 'PL/SQL Packages and Types Reference'.
If you have access to OEM ... you can configure this there using wizard.....
Other way is to use the External Procedure call capabiblity of Oracle DB Server...:
http://www.oracle.com/pls/db102/ranked?word=external+procedure+call&remark=federated_search
My greetings,
Sim -
Jasper report with Struts2 and hibernate.
Hey all!
I'm new to Struts2, Hibernate and jasper report. I want to make a report using those tools. Can anybody pls help me by providing a step by step process for it?
I'm using eclipse Ganymede IDE. And want to view report on page with two search criteria as start date to end date and an option choosing.
Can any body pls response me for this?Yes you can, you'll need to create a new library in JDeveloper with the Jasper reports JARs.
See: Re: JasperReport with Jdeveloper -
dear all,
i'm now trying to integrate jasper report in ADF..
and i'm try to code this code at bean..but its error..
public void runOracleReport(ActionEvent actionEvent) {
JRBeanCollectionDataSource ds = new JRBeanCollectionDataSource(PopulateBean.createBeanCollection());
Map parameters = new HashMap();
parameters.put("branchval", getBranchId());
try
InputStream input = new FileInputStream(new File("C:\\Users\\user\\.ireport\\4.7.0\\config\\Templates\\Report\\GenerateOfferLetter.jrxml"));
OutputStream os = new FileOutputStream(new File("C:\\Users\\user\\Desktop\\ICEMS\\Report\\offerLetter.pdf"));
JasperDesign jasperDesign = JRXmlLoader.load(input);
JasperReport jasperReport = JasperCompileManager.compileReport(jasperDesign);
JasperPrint jasperPrint = JasperFillManager.fillReport(jasperReport, parameters, conn);
JasperExportManager.exportReportToPdfStream(jasperPrint, os);
JasperViewer.viewReport(jasperPrint, false);
catch (JRException e) {e.printStackTrace();}
catch (Exception e) {e.printStackTrace();}
is it any connection code that i have to write..
Thank youthank you very2 much..it helps me al lot..
2 questions taht i confused:
1: Is it query at adf must be same at query jasper?
2: Is it this code is valid code when i want to call more than parameters:
Map parameters = new HashMap();
parameters.put("branchval", getBranchId());
parameters.put("degreeVal", getDegreeId());
parameters.put("intakeVal", getIntakeId());
parameters.put("typeOfferVal", getTypeOfferId());
parameters.put("jasperParamenterName", "ParameterValue"); Used if you want to pass a parameter to a jasper report
JasperPrint print = JasperFillManager.fillReport(report, parameters, conn);
Thank you -
i have table name student in my MS access data base. student have column name class,section, rollno,studdof... etc . Class Field contains data I ,II,III Std. etc similar to section contains A,B,C etc i want to generate a jasper report by selecting particular class,section eg. i am selecting class I and section B using combobox my problem is that how to pass this condition in java pro to generate jasper report for particulas class and section
Edited by: faizan on Jun 9, 2008 11:53 PMThose extra pieces are from my program and there just to show where I was getting the variables to pass to the map.
You can replace them with your our variables you need for your reports. -
Hi can someone plz tell me integration of ireport with Myeclipse
or how can i use jasper report as i want reports to hav output in pdf and html and i'm using spring/hibernate as persistence .
thanks in advance.Hi Shariff,
have you already googled for "apex integrate jasper"? It returns several how-to's.
Regards
Patrick
My Blog: http://www.inside-oracle-apex.com
APEX Plug-Ins: http://apex.oracle.com/plugins
Twitter: http://www.twitter.com/patrickwolf -
How to open Jasper report in New window (new Browser,new Tab)
Hi,
I'm Using oracle jdeveloper 11.1.1.4.0 fusion middleware for Jasper report. i want to open the Jasper report in new window
In Application On click of CommandMenuItem(ExportToHTML)it opens the New Window,.While opnening this window i want to call a method (This method opens the jasper report in current browser)
I Tried the afterPhase and beforePhase for this but doesnt work for me.while executing this using beforePhase I'm getting following Exception :
Pls Help on this.Thanks in Advance......!!
Java.lang.IllegalStateException: strict servlet API: cannot call getOutputStream() after getWriter()
at weblogic.servlet.internal.ServletResponseImpl.getOutputStream(ServletResponseImpl.java:280)
at javax.servlet.ServletResponseWrapper.getOutputStream(ServletResponseWrapper.java:112)
at ReportsDisplayBean.exportHtmlReport(ReportsDisplayBean.java:272)Is any other way to do this ? :(
Thanks.Hi,
The view itself is a Web Part called an XSLT List View Web Part (XLV for short). This Web Part is stored on an ASPX page that is by default associated with a list or library on your site.
I suggest you can check if the view page is valid, also, you can try to create another view, then redirect to the view page to see if there is xslt in the page.
Here are some detailed articels for your reference:
Create a custom list view using SharePoint Designer
Using SharePoint Designer 2010 to Work with Web Parts
How to: Customize the Rendering of a Field on a List View
Best Regards
Zhengyu Guo
TechNet Community Support
Maybe you are looking for
-
Crystal Reports for VS2005 causes a Redistributable error for Windows 7
HI, I believe I also have a compatibility iossue with pre-bundeled Visual Studio 2005 (VS2005) Crystal Reports and Windows 7 using an XP development environment on a virtual PC. I had built and published my VS 2005 desktop application code on a virtu
-
I would like to purchase spyware for my mac ...what should I get?
I'm looking for spyware that is compatible to my M ac. I need to monitor my children while they are on IM, social media and emails. Any suggestions?
-
Unable to find the list of datasources in RSA5
Hi All, I am not able to see the list of datasources in RSA5, Ours is a new system and we are in process of implementing the SD and MM modules. I wanted to activate the datasources related to SD and MM. When I went into t-code RSA5 I am getting a mes
-
Can't find setting for IE10 Compatibility View in Group Policy Management Console.
Hoping this is easy. I'm trying to use the Group Policy setting for Compatibility View under Computer Configuration/Administrative Templates/Windows Components/Internet Explorer and it is not there. The domain controllers are 2008 Standard SP2, so no
-
I lost my password and my email used to create the account is no longer working... how to reset the email and the password... all apps I bought was under the user created.