Problem with a custom tag using Jasper Report

Hi everybody, I'm deprived of hope,
I wrote this code for a custom taglib to convert a .jasper file into a .pdf file:
package com.tag;
import javax.servlet.jsp.*;
import javax.servlet.jsp.tagext.*;
import net.sf.jasperreports.engine.*;
import net.sf.jasperreports.engine.export.*;
import net.sf.jasperreports.engine.util.*;
import net.sf.jasperreports.view.*;
import java.sql.*;
import org.apache.commons.logging.*;
import java.io.*;
import java.util.*;
public class GeneratePDF extends TagSupport
private String sourceFileName = "C:\\default.jasper";
private String destinationFileName = "C:\\default.pdf";
public void setSourceFileName(String sourceFileName)
this.sourceFileName = sourceFileName;
public void setDestinationFileName(String destinationFileName)
this.destinationFileName = destinationFileName;
public int doStartTag()
return SKIP_BODY;
public int doEndTag()
try
//Passaggio parametri da passare al jasper.
Map parameters = new HashMap();
parameters.put("param1", new Integer(1));
//Preparazione del file da stampare (in questa fase si esegue la query e si inseriscono
//i valori estratti dalla query)
JasperPrint jasperPrint=JasperFillManager.fillReport(sourceFileName, parameters, getConnection());
//Creazione del PDF
JasperExportManager.exportReportToPdfFile(jasperPrint, destinationFileName);
System.exit(0);
catch(Exception e)
{ e.printStackTrace();}
return EVAL_PAGE;
/**Metodo per creare la connessione al DB*/
private static Connection getConnection() throws ClassNotFoundException, SQLException {
//Change these settings according to your local configuration
String driver = "sun.jdbc.odbc.JdbcOdbcDriver";
String connectString = "jdbc:odbc:gecoware";
String user = "admin";
String password = "password";
Class.forName(driver);
Connection conn = DriverManager.getConnection(connectString, user, password);
return conn;
No errors while compile but in execution I have this message:
javax.servlet.ServletException: net/sf/jasperreports/engine/JasperFillManager
org.apache.jasper.runtime.PageContextImpl.doHandlePageException(PageContextImpl.java:872)
org.apache.jasper.runtime.PageContextImpl.access$1100(PageContextImpl.java:114)
org.apache.jasper.runtime.PageContextImpl$12.run(PageContextImpl.java:792)
java.security.AccessController.doPrivileged(Native Method)
org.apache.jasper.runtime.PageContextImpl.handlePageException(PageContextImpl.java:790)
org.apache.jsp.reportPDF_jsp._jspService(reportPDF_jsp.java:80)
org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:141)
javax.servlet.http.HttpServlet.service(HttpServlet.java:861)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:325)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:306)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:253)
javax.servlet.http.HttpServlet.service(HttpServlet.java:861)
sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
java.lang.reflect.Method.invoke(Method.java:324)
org.apache.catalina.security.SecurityUtil$1.run(SecurityUtil.java:289)
java.security.AccessController.doPrivileged(Native Method)
javax.security.auth.Subject.doAsPrivileged(Subject.java:500)
org.apache.catalina.security.SecurityUtil.execute(SecurityUtil.java:311)
org.apache.catalina.security.SecurityUtil.doAsPrivilege(SecurityUtil.java:205)
root cause
java.lang.NoClassDefFoundError: net/sf/jasperreports/engine/JasperFillManager
com.tag.GeneratePDF.doEndTag(GeneratePDF.java:49)
org.apache.jsp.reportPDF_jsp._jspx_meth_JR_GeneratePDF_0(reportPDF_jsp.java:97)
org.apache.jsp.reportPDF_jsp._jspService(reportPDF_jsp.java:68)
org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:141)
javax.servlet.http.HttpServlet.service(HttpServlet.java:861)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:325)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:306)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:253)
javax.servlet.http.HttpServlet.service(HttpServlet.java:861)
sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
java.lang.reflect.Method.invoke(Method.java:324)
org.apache.catalina.security.SecurityUtil$1.run(SecurityUtil.java:289)
java.security.AccessController.doPrivileged(Native Method)
javax.security.auth.Subject.doAsPrivileged(Subject.java:500)
org.apache.catalina.security.SecurityUtil.execute(SecurityUtil.java:311)
org.apache.catalina.security.SecurityUtil.doAsPrivilege(SecurityUtil.java:205)
Please HELP ME !!!!!!!!!
Thank you in advance
AleX

Do you have the Jasper classes in /WEB-INF/lib?

Similar Messages

  • Initial problem with JSP Custom Tag devolopment

    Hi ,
    I have encountered a problem with my JSP application which utilizes a simple custom tag.
    First I created followinng directories.
    1. %TOMCAT_HOME%\webapps\testTags
    2. %TOMCAT_HOME%\webapps\testTags\META-INF
    3. %TOMCAT_HOME%\webapps\testTags\WEB-INF
    4. %TOMCAT_HOME%\webapps\testTags\WEB-INF\tlds
    5. %TOMCAT_HOME%\webapps\testTags\WEB-INF\classes
    6. %TOMCAT_HOME%\webapps\testTags\WEB-INF\classes\com
    7. %TOMCAT_HOME%\webapps\testTags\WEB-INF\classes\com\tek271
    8. %TOMCAT_HOME%\webapps\testTags\WEB-INF\classes\com\tek271\testTags
    I created the essential four files, that is named as follows.
    1.TagError.java
    2.web.xml
    3.testTld.tld
    4.testJsp.jsp
    Then i put the files under these directories as given below
    testJsp.jsp under %TOMCAT_HOME%\webapps\testTags.
    web.xml under %TOMCAT_HOME%\webapps\testTags\WEB-INF
    TagError.java under %TOMCAT_HOME%\webapps\testTags\WEB-INF\classes
    TagError.class under %TOMCAT_HOME%\webapps\testTags\WEB-INF\classes\com\tek271\testTags
    testTld.tld %TOMCAT_HOME%\webapps\testTags\WEB-INF\tlds
    Here is the content inside the files.
    1.TagError.java
    package com.tek271.testTags;
    import java.io.*;
    import javax.servlet.jsp.*;
    import javax.servlet.jsp.tagext.*;
    public class TagError extends TagSupport {
    private String mColor = "red";
    public void setColor(String aColor) {
    mColor = aColor;
    } // setColor
    public int doStartTag() throws JspException {
    try {
    JspWriter out = pageContext.getOut();
    out.print("<font color=\"");
    out.print(mColor);
    out.print("\"><b>Error: ");
    } catch (IOException ex) {
    throw new JspTagException(ex.getMessage());
    return EVAL_BODY_INCLUDE; // other return: SKIP_BODY
    } // doStartTag()
    public int doEndTag() throws JspException {
    try {
    JspWriter out = pageContext.getOut();
    out.println("</b></font><br>");
    } catch (IOException ex) {
    throw new JspTagException(ex.getMessage());
    return EVAL_PAGE; // other return: SKIP_PAGE
    } // doEndTag()
    } // TagError
    2.web.xml
    <?xml version="1.0" encoding="ISO-8859-1"?>
    <web-app>
    <taglib>
    <taglib-uri>/testTaglib</taglib-uri>
    <taglib-location>/WEB-INF/tlds/testTld.tld</taglib-location>
    </taglib>
    </web-app>
    3.testTld.tld
    <?xml version="1.0" encoding="ISO-8859-1" ?>
    <!DOCTYPE taglib
    PUBLIC "-//Sun Microsystems, Inc.//DTD JSP Tag Library 1.1//EN"
    "http://java.sun.com/j2ee/dtds/web-jsptaglibrary_1_1.dtd">
    <taglib>
    <tlibversion>1.0</tlibversion>
    <jspversion>1.1</jspversion>
    <shortname>testTld</shortname>
    <info>Testing jsp tags</info>
    <tag>
    <name>tagError</name>
    <tagclass>com.tek271.testTags.TagError</tagclass>
    <bodycontent>JSP</bodycontent> <!-- Also: empty, tagdependent -->
    <info>Show a string as an error message</info>
    <attribute>
    <name>color</name>
    <required>false</required>
    </attribute>
    </tag>
    </taglib>
    4.testJsp.jsp
    <%@ taglib uri="/testTaglib" prefix="test" %>
    <html>
    <head>
    <title>Testing Tag Library</title>
    </head>
    <body>
    <test:tagError>Invalid user name</test:tagError>
    <test:tagError color="blue">Invalid Password</test:tagError>
    </body>
    </html>
    but i am getting the following error.
    Apache Tomcat/4.0.3 - HTTP Status 500 - Internal Server Error
    type Exception report
    message Internal Server Error
    description The server encountered an internal error (Internal Server Error) that prevented it from fulfilling this request.
    exception
    org.apache.jasper.JasperException: File "/testTaglib" not found
    at org.apache.jasper.compiler.TagLibraryInfoImpl.(TagLibraryInfoImpl.java:214)
    at org.apache.jasper.compiler.TagLibraryInfoImpl.(TagLibraryInfoImpl.java:174)
    at org.apache.jasper.compiler.JspParseEventListener.processTaglibDirective(JspParseEventListener.java:1162)
    at org.apache.jasper.compiler.JspParseEventListener.handleDirective(JspParseEventListener.java:758)
    at org.apache.jasper.compiler.DelegatingListener.handleDirective(DelegatingListener.java:121)
    at org.apache.jasper.compiler.Parser$Directive.accept(Parser.java:255)
    at org.apache.jasper.compiler.Parser.parse(Parser.java:1145)
    at org.apache.jasper.compiler.Parser.parse(Parser.java:1103)
    at org.apache.jasper.compiler.Parser.parse(Parser.java:1099)
    at org.apache.jasper.compiler.ParserController.parse(ParserController.java:213)
    at org.apache.jasper.compiler.Compiler.compile(Compiler.java:210)
    at org.apache.jasper.servlet.JspServlet.loadJSP(JspServlet.java:552)
    at org.apache.jasper.servlet.JspServlet$JspServletWrapper.loadIfNecessary(JspServlet.java:177)
    at org.apache.jasper.servlet.JspServlet$JspServletWrapper.service(JspServlet.java:189)
    at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:382)
    at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:474)
    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:243)
    at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:566)
    at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472)
    at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
    at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:190)
    at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:566)
    at org.apache.catalina.valves.CertificatesValve.invoke(CertificatesValve.java:246)
    at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:564)
    at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472)
    at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
    at org.apache.catalina.core.StandardContext.invoke(StandardContext.java:2343)
    at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:180)
    at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:566)
    at org.apache.catalina.valves.ErrorDispatcherValve.invoke(ErrorDispatcherValve.java:170)
    at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:564)
    at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:170)
    at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:564)
    at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:468)
    at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:564)
    at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472)
    at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
    at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:174)
    at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:566)
    at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472)
    at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
    at org.apache.catalina.connector.http.HttpProcessor.process(HttpProcessor.java:1012)
    at org.apache.catalina.connector.http.HttpProcessor.run(HttpProcessor.java:1107)
    at java.lang.Thread.run(Thread.java:536)
    why is it like this ?please give me a solution.
    Thanking in advance.
    From
    Vinod A.

    Dear patreck ,
    It does not work.
    I have replaced the line
    <%@ taglib uri="/testTaglib" prefix="test" %>
    with
    <%@ taglib uri="WEB-INF/tlds/testTaglib" prefix="test" %>
    but now it shows the error ,
    description The server encountered an internal error (Internal Server Error) that prevented it from fulfilling this request.
    exception
    org.apache.jasper.JasperException: File "/testTags/WEB-INF/tlds/testTaglib" not found
    any more suggestion ?
    From Vinod A.

  • Problem with creating customer account using TCA Java API

    Hi,
    I am trying to create customer account using TCA java API. i am getting exception saying PL/SQL numeric error: character to number conversion. but this error raises when calling API method
    HzCustAccountV2Pub.createCustAccount.
    can any body help me in solving this issue, any clue why this exception raises. i have tested even the code given in TCA API user guide. that code also gets same error.

    package client;
    import java.math.BigDecimal;
    import java.sql.Timestamp;
    import java.sql.DriverManager;
    import java.sql.SQLException;
    import oracle.jdbc.driver.OracleConnection;
    import oracle.jdbc.driver.OracleCallableStatement;
    import oracle.jdbc.driver.OracleTypes;
    import oracle.apps.ar.hz.v2api.HzCustAccountV2Pub;
    import oracle.apps.ar.hz.v2api.HzPartyV2Pub;
    import oracle.apps.ar.hz.v2api.HzCustomerProfileV2Pub;
    class CreateCustAccount {
         public static void main(String[] args) throws Exception {
         HzCustAccountV2Pub.CustAccountRec p_cust_account_rec = new HzCustAccountV2Pub.CustAccountRec();
         HzPartyV2Pub.PersonRec p_person_rec = new HzPartyV2Pub.PersonRec();
         HzCustomerProfileV2Pub.CustomerProfileRec p_customer_profile_rec = new      HzCustomerProfileV2Pub.CustomerProfileRec();
         BigDecimal[] x_cust_account_id = new BigDecimal[1];
         String[] x_account_number = new String[1];
         BigDecimal[] x_party_id = new BigDecimal[1];
         String[] x_party_number = new String[1];
         BigDecimal[] x_profile_id = new BigDecimal[1];
         String[] x_return_status = new String[1];
         BigDecimal[] x_msg_count = new BigDecimal[1];
         String[] x_msg_data = new String[1];
         try
         Class.forName ("oracle.jdbc.driver.OracleDriver");
         OracleConnection conn = (OracleConnection) DriverManager.getConnection ("jdbc:oracle:thin:@ebiztst.trianz.int:1526:PATCH","apps","apps");
         HzCustAccountV2Pub custaccountV2Pub = new HzCustAccountV2Pub();
         p_cust_account_rec.account_name = "John Ac";
         p_person_rec.person_first_name = "John";
         p_person_rec.person_last_name = "Smith";
         p_cust_account_rec.created_by_module = "TCA_EXAMPLE";
         HzCustAccountV2Pub.createCustAccount(
         conn
         , "T"
         , p_cust_account_rec
         , p_person_rec
         , p_customer_profile_rec
         , "F"
         , x_cust_account_id
         , x_account_number
         , x_party_id
         , x_party_number
         , x_profile_id
         , x_return_status
         , x_msg_count
         , x_msg_data
         System.out.println( "x_return_status = " + x_return_status[0] );
         System.out.println( "x_msg_count = " + x_msg_count[0] );
         System.out.println( "x_msg_data = " + x_msg_data[0]);
         if (x_msg_count[0].intValue() > 1) {
              OracleCallableStatement ocs = null;
              for (int i=0; i<x_msg_count[0].intValue(); i++) {
              ocs = (OracleCallableStatement)conn.prepareCall(
              "begin ? := fnd_msg_pub.get( p_encoded => ’F’ ); end;");
              ocs.registerOutParameter(1, OracleTypes.VARCHAR);
              ocs.execute();
              System.out.println((i + 1) + ". " + ocs.getString(1));
              conn.close();
              } catch (ClassNotFoundException e) {
              System.out.println("Driver Not Found: " + e);
              } catch (SQLException e) {
              System.out.println("SQL Error." + e);
    }

  • Problems with parameterized custom tags - urgent

    Hi All,
    I am not able to retrieve my attribute values in Tag Support Class?
    it doesn't give any errors while compiling and also the tag works without those attributes. I am able to print some html using the same tag but not able to print the passed attribute values?
    any help is highly appreciated!
    Thank You.....:-)

    Thanks for the response!
    Infact I figured it out and made it working but still it's a question to me.
    Change I have made in my .tld file is making rtexprvalue to true - "<rtexprvalue>true</rtexprvalue>".
    As per documentation it should matter but bcoz of this setting to false I was not able to retrieve.
    Anyways Thanks again & Have a Good Day.....:-)

  • Problem in using Jasper Reports with JFrames

    Hi,
    I am using Jasper Reports in Swings.
    I could Generate Jasper Reports from JFrames with out any problem,
    but while closing the Report, the JFrame is also getting closed automatically.
    this should not happen for my application.
    So, how could i restrict the JFrame from exiting when Jasper Reports are closed.
    Thanx in advance.
    Reddy

    Create jasperviewer object as JasperViewer jasperViewer = new JasperViewer(jasperPrint, false);

  • Using jasper Reports with Tomcat5.5

    hi ,
    i am trying to use Jasper Reports with Tomcat 5.5 but not able to do it.
    i have written a simple java program to read data from MySql database and generate a report in PDF format. the good thing is that when i am doing this as a independent java program and running it in Eclipse3.2 then its working fine. but i am not able to run it as a sevlet thru Tomcat5.5.
    any help ? is there any issue with version ...
    i am using JDK 1.5 , Tomcat5.5
    regs,
    sajid

    i am not able to figure it out. usually all web app picks files in WEB-INF folder . see below the exception ....
    type Exception report
    message
    description The server encountered an internal error () that prevented it from fulfilling this request.
    exception
    javax.servlet.ServletException: Servlet execution threw an exception
         org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)
    root cause
    java.lang.VerifyError: (class: net/sf/jasperreports/engine/xml/JRXmlDigesterFactory, method: configureDigester signature: (Lorg/apache/commons/digester/Digester;)V) Incompatible argument to function
         net.sf.jasperreports.engine.xml.JRXmlLoader.load(JRXmlLoader.java:202)
         net.sf.jasperreports.engine.JasperCompileManager.compileReport(JasperCompileManager.java:195)
         com.iflex.poc.reports.ReportManager.generateReport(ReportManager.java:25)
         com.iflex.poc.reports.ReportServlet.doGet(ReportServlet.java:15)
         javax.servlet.http.HttpServlet.service(HttpServlet.java:740)
         javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
         org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)
    note The full stack trace of the root cause is available in the Apache Tomcat/5.5.16 logs.

  • How to call a method repeatedly with JSP custom tag?

    This senerio is very similar to the usage of StringBuffer.
    I have a problem which can be solved easily with scriptlets:
    <% NameValuePair nvp = new NameValuePair(request.getQueryString()); %>
    <a href="foo.html?<%=nvp.add(name1", "value1").add("name2", "value2").toString();%">">Foo</a>
    <a href="bar.html?<%=new NameValuePair(request.getQueryString()).add("x", 1).add("y", 2).toString()%>">Bar</a>
    But I cannot use scriplets because it's turned off. I can only use jsp custom tag / jstl. How would I implement this functionality with a custom tag? How would the JSP code look like? Our container supports JSP 2.0.
    Thanks.</a>

    hi,
    you can do within 2 step-
    1) use <%@page import="your_java_class"%>
    2)use scriptlet code <%...%> and write coding in this tag.
    means create instance of your java class .
    <% your_java_class obj1=new your_java_class();
         obj1.method_of_your_java_class();
    %>or
    3) you can make javabean to use method of java class.[Best option]
    Thanx
    Ranvijay

  • Rendering A JPEG image with a custom tag

    Hi All,
    I have dilema. I'm trying to rendering a jpeg in IE/FireFox with a custom tag that I developed. I'm able to access the bean and invoke the getter method to return the InputStream property. But what gets rendered is the byte code not the image. I've tried just about anything I could think off. If any body has an answer I would difinitely appreciate it.
    Thanks,
    Tony
    Below is the jsp, tld, bean and tag.
    ********************************* image.jsp ****************************************
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <%@ taglib uri="/WEB-INF/custom-chtml.tld" prefix="chtml" %>
    <html>
    <head>
    <title>HTML Page</title>
    </head>
    <body bgcolor="#FFFFFF">
    <chtml:img name="photo" property="file"/>
    </body>
    </html>
    ********************************* custom-chtml.tld **********************************
    <?xml version="1.0" encoding="UTF-8"?>
    <!DOCTYPE taglib PUBLIC "-//Sun Microsystems, Inc.//DTD JSP Tag Library 1.1//EN" "http://java.sun.com/j2ee/dtds/web-jsptaglibrary_1_1.dtd">
    <taglib>
    <tlibversion>1.0</tlibversion>
    <jspversion>1.1</jspversion>
    <shortname>chtml</shortname>
    <tag>
    <name>img</name>
    <tagclass>com.struts.taglib.CustomImgTag</tagclass>
    <bodycontent>empty</bodycontent>
    <attribute>
    <name>name</name>
    <required>false</required>
    <rtexprvalue>true</rtexprvalue>
    </attribute>
    <attribute>
    <name>property</name>
    <required>true</required>
    <rtexprvalue>true</rtexprvalue>
    </attribute>
    </tag>
    </taglib>
    **************************** MemberPhotoBean.java ******************************
    import java.io.InputStream;
    * @author tony
    * TODO To change the template for this generated type comment go to
    * Window - Preferences - Java - Code Style - Code Templates
    public class MemberPhotoValue {
         private String memberId;
         private int fileSize;
         private InputStream file;
         public MemberPhotoValue() {
         public MemberPhotoValue(String memberId, InputStream file) {
              this.memberId = memberId;
              this.file = file;
         public MemberPhotoValue(String memberId,int fileSize,InputStream file) {
              this.memberId = memberId;
              this.fileSize = fileSize;
              this.file = file;          
         public String getMemberId(){
              return memberId;
         public void setMemberId(String memberId) {
              this.memberId = memberId;
         public int getFileSize() {
              return fileSize;
         public void setFileSize(int fileSize) {
              this.fileSize = fileSize;
         public InputStream getFile(){
              return file;
         public void setFile(InputStream file) {
              this.file = file;
    *************************** CustomTagHandler.java ********************************
    import java.io.*;
    import javax.imageio.ImageIO;
    import javax.servlet.*;
    import javax.servlet.jsp.*;
    import javax.servlet.jsp.tagext.*;
    import java.lang.reflect.Method;
    import java.lang.reflect.InvocationTargetException;
    import java.awt.image.*;
    import java.awt.*;
    import javax.swing.ImageIcon;
    import com.sun.image.codec.jpeg.*;
    * JSP Tag Handler class
    * @jsp.tag name = "CustomImg"
    * display-name = "Name for CustomImg"
    * description = "Description for CustomImg"
    * body-content = "empty"
    public class CustomImgTag implements Tag {
         private PageContext pageContext;
         private Tag parent;
         private String property;
         private String name;
         private Class bean;
         public int doStartTag() throws JspException {
              return SKIP_BODY;
         public int doEndTag() throws JspException {
         try {
         ServletResponse response = pageContext.getResponse();
         // read in the image from the bean
         InputStream stream = (InputStream) invokeBeanMethod();
         BufferedImage image = ImageIO.read(stream);          Image inImage = new ImageIcon(image).getImage();
         Graphics2D g = image.createGraphics();
         g.drawImage(inImage,null,null);               
         OutputStream out = response.getOutputStream();
    // JPEG-encode the image
    JPEGImageEncoder encoder = JPEGCodec.createJPEGEncoder(out);
    encoder.encode(image);               
         out.close();     
    } catch (IOException io) {
              throw new JspException(io.getMessage());
         return EVAL_PAGE;
         public void release(){}
    private InputStream invokeBeanMethod() throws JspException {
         try {
         Object bean = null;
         if (null != pageContext.getAttribute(name)) {
         bean = (Object) pageContext.getAttributename);
         else if (null != pageContext.getSession().getAttribute(name)) {
         bean = (Object) pageContext.getSession().getAttribute(name);
         else if (null != pageContext.getRequest().getAttribute(name)) {
         bean = (Object) pageContext.getRequest().getAttribute(name);
         else {
         throw new JspException("Bean : "+name+" is not found in any pe.");
         Class[] parameters = null;
         Object[] obj = null;               
         Method method = bean.getClass().getMethod("getFile",parameters);
         return (InputStream) method.invoke(bean,obj);
         } catch (NoSuchMethodException ne) {
         throw new JspException("No getter method "+property+" for bean : "+bean);
         } catch (IllegalAccessException ie) {
         throw new JspException(ie.getMessage());
         } catch (InvocationTargetException ie) {
         throw new JspException(ie.toString());
         public void setPageContext(PageContext pageContext) {
              this.pageContext = pageContext;
         public void setParent(Tag parent) {
              this.parent = parent;
         public Tag getParent() {
              return parent;
         public void setProperty(String property) {
              this.property = property;
         public void setName(String name) {
              this.name = name;
    **************************************************************************************

    If you have access to an image editing tool such as photoshop, I would advice you import the image into Phototshop and save it in a different format e.g, GIF format and re-import it into Final Cut Express HD. This could solve your rendering problem if all you need is to use a Still image.
    Ayemenre

  • ADF 11G: opening PDF into new Window using Jasper Report

    Hello, I am using JDev 11.1.1.5.0
    I have a page into a bound Task FLow containing a table and a "print "button".
    I am using Jasper Report to create a PDF document.
    I want this document to be opened into a new Window when the user click on the button.
    I've been reading several threads/blogs to do this but it is not working.
    please help me out with the sample or some link where I can refer.
    Thanks
    Sanjeev

    Hi All,
    Today I checked and got the Reason why Server is getting shut down while closing the Report window.... this is just because of JasperViewer.
    so while opening the JasperViewer to show the Report we need to pass the second parameter as False.
    JasperViewer.viewReport(jasperPrint,false);k thanks for your update....
    but still my actual problem exist....
    I don't want to use JasperViewer to view the Report.
    Like when I'm clicking on Button PDF Report is opening in the same Winodw.
                    response.setHeader("Content-Disposition",
                                       "inline; filename=\"ReportFile.pdf\"");it will open as attachment if I'll use the below code and my ShowReport Button is getting disabled....
                    response.setHeader("Content-Disposition",
                                       "attachement; filename=\"ReportFile.pdf\"");As in Page ShowReport Button is getting disabled so after exporting the Report I want to redirect to the page but getting Error like Illegal State Exception: Response Already Commiteed
    Error Log:
    java.lang.IllegalStateException: Response already committed
         at weblogic.servlet.internal.ServletResponseImpl.objectIfCommitted(ServletResponseImpl.java:1608)
         at weblogic.servlet.internal.ServletResponseImpl.sendRedirect(ServletResponseImpl.java:834)
         at javax.servlet.http.HttpServletResponseWrapper.sendRedirect(HttpServletResponseWrapper.java:136)
         at view.org.webcenter.sample.view.servlet.JasperServlet.doPost(JasperServlet.java:156)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:727)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:820)
         at weblogic.servlet.internal.StubSecurityHelper$ServletServiceAction.run(StubSecurityHelper.java:227)
         at weblogic.servlet.internal.StubSecurityHelper.invokeServlet(StubSecurityHelper.java:125)
         at weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.java:300)
         at weblogic.servlet.internal.TailFilter.doFilter(TailFilter.java:26)
         at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
         at oracle.adf.library.webapp.LibraryFilter.doFilter(LibraryFilter.java:175)
         at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
         at weblogic.servlet.internal.RequestDispatcherImpl.invokeServlet(RequestDispatcherImpl.java:524)
         at weblogic.servlet.internal.RequestDispatcherImpl.forward(RequestDispatcherImpl.java:253)
         at org.webcenter.sample.view.bean.JasperReport.callServlet(JasperReport.java:46)
         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:597)
         at com.sun.el.parser.AstValue.invoke(Unknown Source)
         at com.sun.el.MethodExpressionImpl.invoke(Unknown Source)
         at org.apache.myfaces.trinidadinternal.taglib.util.MethodExpressionMethodBinding.invoke(MethodExpressionMethodBinding.java:53)
         at org.apache.myfaces.trinidad.component.UIXComponentBase.broadcastToMethodBinding(UIXComponentBase.java:1256)
         at org.apache.myfaces.trinidad.component.UIXCommand.broadcast(UIXCommand.java:183)
         at oracle.adf.view.rich.component.fragment.ContextSwitchingComponent$1.run(ContextSwitchingComponent.java:92)
         at oracle.adf.view.rich.component.fragment.ContextSwitchingComponent._processPhase(ContextSwitchingComponent.java:361)
         at oracle.adf.view.rich.component.fragment.ContextSwitchingComponent.broadcast(ContextSwitchingComponent.java:96)
         at oracle.adf.view.rich.component.fragment.UIXInclude.broadcast(UIXInclude.java:102)
         at oracle.adf.view.rich.component.fragment.ContextSwitchingComponent$1.run(ContextSwitchingComponent.java:92)
         at oracle.adf.view.rich.component.fragment.ContextSwitchingComponent._processPhase(ContextSwitchingComponent.java:361)
         at oracle.adf.view.rich.component.fragment.ContextSwitchingComponent.broadcast(ContextSwitchingComponent.java:96)
         at oracle.adf.view.rich.component.fragment.UIXInclude.broadcast(UIXInclude.java:96)
         at javax.faces.component.UIViewRoot.broadcastEvents(UIViewRoot.java:475)
         at javax.faces.component.UIViewRoot.processApplication(UIViewRoot.java:756)
         at oracle.adfinternal.view.faces.lifecycle.LifecycleImpl._invokeApplication(LifecycleImpl.java:788)
         at oracle.adfinternal.view.faces.lifecycle.LifecycleImpl._executePhase(LifecycleImpl.java:306)
         at oracle.adfinternal.view.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:186)
         at javax.faces.webapp.FacesServlet.service(FacesServlet.java:265)
         at weblogic.servlet.internal.StubSecurityHelper$ServletServiceAction.run(StubSecurityHelper.java:227)
         at weblogic.servlet.internal.StubSecurityHelper.invokeServlet(StubSecurityHelper.java:125)
         at weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.java:300)
         at weblogic.servlet.internal.TailFilter.doFilter(TailFilter.java:26)
         at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
         at oracle.adf.model.servlet.ADFBindingFilter.doFilter(ADFBindingFilter.java:205)
         at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
         at oracle.adfinternal.view.faces.webapp.rich.RegistrationFilter.doFilter(RegistrationFilter.java:106)
         at org.apache.myfaces.trinidadinternal.webapp.TrinidadFilterImpl$FilterListChain.doFilter(TrinidadFilterImpl.java:446)
         at oracle.adfinternal.view.faces.activedata.AdsFilter.doFilter(AdsFilter.java:60)
         at org.apache.myfaces.trinidadinternal.webapp.TrinidadFilterImpl$FilterListChain.doFilter(TrinidadFilterImpl.java:446)
         at org.apache.myfaces.trinidadinternal.webapp.TrinidadFilterImpl._doFilterImpl(TrinidadFilterImpl.java:271)
         at org.apache.myfaces.trinidadinternal.webapp.TrinidadFilterImpl.doFilter(TrinidadFilterImpl.java:177)
         at org.apache.myfaces.trinidad.webapp.TrinidadFilter.doFilter(TrinidadFilter.java:92)
         at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
         at oracle.adf.library.webapp.LibraryFilter.doFilter(LibraryFilter.java:175)
         at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
         at oracle.security.jps.ee.http.JpsAbsFilter$1.run(JpsAbsFilter.java:111)
         at java.security.AccessController.doPrivileged(Native Method)
         at oracle.security.jps.util.JpsSubject.doAsPrivileged(JpsSubject.java:313)
         at oracle.security.jps.ee.util.JpsPlatformUtil.runJaasMode(JpsPlatformUtil.java:413)
         at oracle.security.jps.ee.http.JpsAbsFilter.runJaasMode(JpsAbsFilter.java:94)
         at oracle.security.jps.ee.http.JpsAbsFilter.doFilter(JpsAbsFilter.java:161)
         at oracle.security.jps.ee.http.JpsFilter.doFilter(JpsFilter.java:71)
         at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
         at oracle.dms.servlet.DMSServletFilter.doFilter(DMSServletFilter.java:136)
         at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
         at weblogic.servlet.internal.RequestEventsFilter.doFilter(RequestEventsFilter.java:27)
         at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
         at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.wrapRun(WebAppServletContext.java:3715)
         at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.run(WebAppServletContext.java:3681)
         at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:321)
         at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:120)
         at weblogic.servlet.internal.WebAppServletContext.securedExecute(WebAppServletContext.java:2277)
         at weblogic.servlet.internal.WebAppServletContext.execute(WebAppServletContext.java:2183)
         at weblogic.servlet.internal.ServletRequestImpl.run(ServletRequestImpl.java:1454)
         at weblogic.work.ExecuteThread.execute(ExecuteThread.java:209)
         at weblogic.work.ExecuteThread.run(ExecuteThread.java:178)please help me out with the sample or some link where I can refer, its very important.
    Thanks
    Sanjeev
    Edited by: Sanjeev on Jun 5, 2013 10:50 PM

  • Problem while incrementing a variable in Jasper Reports

    Hi
    I am using Jasper Reports for designing reports. These reports will be used by my Java application.
    But there is problem while I am trying to increment a variable depending on some condition.
    Requirement: I have to display information about all the residents in a hospital in a single report. Resident information will be fetched from the XML file. When a resident ID is found in the XML, then the variable(resno) shoud be incremented. I have set the initial value to 1.
    Problem: Only for the first resident, resno is showing as 1. For all the remaining residents, its showing as 0 (zero).The variable 'resno' is not incrementing for each resident.
    Even the ResidentID is not null. All the ResidentID's exists in the XML file.
    Please find the code below.
    <variable name="resno" class="java.lang.Integer" incrementType="Group" incrementGroup="residentbrk" calculation="Count">
    <initialValueExpression><![CDATA[new Integer(1)]]></initialValueExpression>
    </variable>
    <group name="residentbrk" isStartNewPage="true">
    <groupExpression><![CDATA[$F{ResidentID}]]></groupExpression>
    <groupHeader>
    <band height="16">
    <textField hyperlinkType="None">
    <reportElement positionType="Float" x="0" y="-1" width="96" height="17"/>
    <textElement>
    <font isBold="true"/>
    </textElement>
    <textFieldExpression class="java.lang.String"><![CDATA[$R{residentno}]]></textFieldExpression>
    </textField>
    <textField hyperlinkType="None">
    <reportElement positionType="Float" x="96" y="-2" width="64" height="18"/>
    <textElement/>
    <textFieldExpression class="java.lang.Integer"><![CDATA[$V{resno}]]></textFieldExpression>
    </textField>
    </band>
    </groupHeader>
    </group>
    Could you please provide a solution for this.

    Not clear at all. May be like this
    declare
    v_temp varchar2(100);
    v_final number;
    begin
    --loop
    v_temp:='sun';
    v_temp:=translate(lower(v_temp), '1abcdefghijklmnopqrstuvwxyz', '1');
    dbms_output.put_line('Temp:'||v_temp);
    v_temp := v_temp || 'Mon5.1';
    v_temp:=translate(lower(v_temp), '1abcdefghijklmnopqrstuvwxyz', '1');
    dbms_output.put_line('Temp:'||v_temp);
    v_temp:= v_temp || 'Tue';
    v_temp:=translate(lower(v_temp), '1abcdefghijklmnopqrstuvwxyz', '1');
    dbms_output.put_line('Temp:'||v_temp);
    v_final:=to_number(v_temp);
    dbms_output.put_line('v_final'||v_final);
    --coalesce
    --end loop;
    end;
    /

  • Help in using  Jasper Report  in JSC !

    Hi,
    I am new to this forum and Studio creator as well.
    I made a Web Application with creator.Now i need to make reports of the data in my web application.
    I have heard of Jasper Report.
    But I am unable to find out ,from where to start with in Creator for incorporating Jasper Reports.
    I have read some posts in this forum regarding Jasper Reports.But i am having difficulty to start with.My web application is using Oracle 8i as datasource.
    Can anybody help in this regard
    Thanks .

    Thanks for ur reply,
    I have already read that thread.But that is a bit complex for me.
    I am finding it difficult ,from where to start with.
    That is ,where to put the code for calling the report creation procedure.
    where to put the xml file for the design of the report.
    Can somebody tell me ?
    Thanks again.

  • Problems with a VBA Userform using Multipage (2) and DTPicker.

     
    Hi
    Problems with a VBA Userform using Multipage (2) and DTPicker (4)
    On Page1 I've got 2 DTPicker, one for the date and the second for the time.
    Same thing on Page 2.
    Problem:
    Only one set will work, if I close the Userform with" MultiPage"on page2, only that set will work.
    Same thing if I close on Page 1 then just the set on Page 1 will work.
    As anyone seen this problem and any work around you may think would help.
    I'm using Windows 7 , Ms Office Pro. 2003
    same problem on Windows Vista , XL2003
    Cimjet

    There are a number of issues relating to the way that date pickers are handled, but the most important is that their output is text. In order to get the values into Excel, you need to format the Excel columns as Date and Custom (time format) and convert
    the output to the worksheet from text to date values.
    Date pickers also display a few anomalies on multi-page forms, so you need a belt and braces approach. Personally I would put the code to call the form and enter the values in a standard module (as now in the example) and use a belt and braces approach to
    maintaining the format.
    I think you will find the example now works.
    Revised Example
    Graham Mayor - Word MVP
    www.gmayor.com

  • Beginner trying to use Jasper Reports

    Hi,
    I am a beginner in implementing report generation. I want to use Jasper reports to convert my xml to pdf using the ireport plugin in Netbeans
    Presently i have an input xml, i do not want to make an JDBC connection or an database connection, i am using another tool to generate xml output from the database.
    i get my input xml and i want to convert into pdf, is there any way to do that??
    thanks a lot

    You should probably find a forum that deals with Jasper Reports, this one is not it.

  • How to deploy Jdeveloper application to war file using jasper reports?

    Hello people,
    I´m not sure I this is the right place to ask, but I really need help.
    I´m using Jdeve 10.1.3.2
    My application is working perfectly. However when I deploy to war file in publish it into application server OC4J. I can´t print report.
    the error says that it can´t find jrxml file.
    I´ve tried to deploy report´s files with the applicaiton. I´ve tried just to set the path of the jrxml file. but nothing works.
    How can I deploy my applicattion to use Jasper reports correctly?
    Thanks willian

    Hi,
    I think first you need to wrap it into an EAR file, then you can deploy it.
    As far as I know standalone deployment of WAR is deprecated as of 640.
    similar threads:
    How to deploy .war on NWDI
    Deploying an existing WAR file into the Portal
    Hopefully this tutorial also gives some idea:
    http://help.sap.com/saphelp_nw70ehp1/helpdata/en/70/13353094af154a91cbe982d7dd0118/frameset.htm
    Regards,
    Ervin

  • Problem with InputSelect Data Tag if there is no register in database

    Hello all,
    I4m working with Oracle JDeveloper 3.2.2 and I have a problem with InputSelect Data Tag.
    When I tried to access a JSP page with this object and there was n't a record at the table, an error occurred.

    All the input tags operate on rows in the cache. Prior to using the input tags, use the Row tag with the 'Create' option to make sure you have a valid row.

Maybe you are looking for

  • JVC Camera shot in 720P60 settings are not working correctly in FCP

    FCP setting 720p60 yet when we export it comes out as 720X480 Help!!!!!!!!

  • IPhone - Syncing with computer

    As this is my first post, I apologise if this has been dealt with elsewhere. I have a new computer with office 2007 installed, and of course itunes. I have my trusty 3G iphone, and it syncs all my contacts / calender / etc, but I cannot drag any musi

  • Problem in BDC for MD74

    Hi all, When i give the input (plant code,date) in MD74 directly, it is deleting all PIRs upto the given date. While passing the same input through BDC, it is not deleting some of the data. I couldn't find the clue. Can anyone help to solve this issu

  • Timeout error when submitting feedburner podcast feed to itunes

    This is my first time submitting my podcast to itunes, I have created the feed with feedburner and I can manually subscribe and download the podcast in itunes however when i try to submit the feed I recieve the generic timout error, see below. I have

  • How did I accidentally convert all my images to 8-bit?

    Hello, Five minutes ago, I verified that my image in Camera Raw prior to importing into Adobe Photoshop CS6 was in 16-bit mode. Immediately after I imported it into Photoshop and it became a .psd document, I verified once again that it was still in 1