Sending content of a jsp to a printer

i'v some reports in the form of text in jsp and in the future i have to prepare some reports in the form of graphs(which i don't know how to) and on the click of a button the content should be printed on a printer. can you help me in this regard.
awaiting reply
regards
chandu

Hello ,
It is very easy.
Just disply a button called and name it is as "Print " and then
on click event of button write the following code
document.print
it will print your current page.This will solve your problem
bye
Apratim Khandalkar

Similar Messages

  • Probelm in Sending Parameters/Attributes in JSP

    I have the following two file and i want to send parameters for index.jsp to middle.jsp and print them. But when i run the files there print "null" value at <%= request.getAttribute("myparameter")%> in midle.jsp.
    Index.jsp
    <%@page contentType="text/html" pageEncoding="UTF-8"%>
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
    "http://www.w3.org/TR/html4/loose.dtd">
    <html>
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <title>JSP Page</title>
    </head>
    <body>
    <h1>Hi, I am Zaid from Karachi and My hobby is Cricket</h1>
    <h1>Whats Your Name, Hobby and where you belong</h1>
    <form method="GET" action="middle.jsp">
    <input type="text" name="username" size="25">
    <input type="text" name="hobby" size="25"><p></p>
    <input type="text" name="city" size="25"><p></p>
    <input type="submit" value="Submit">
    <input type="reset" value="Reset">
    </form>
    <%
    request.setAttribute("myparameter", "Passion");
    %>
    </body>
    </html>
    middle.jsp
    <%@page contentType="text/html" pageEncoding="UTF-8"%>
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
    "http://www.w3.org/TR/html4/loose.dtd">
    <html>
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <title>JSP Page</title>
    </head>
    <body>
    <h1>Hello World---!</h1>
    <%= request.getAttribute("myparameter")%>
    <%= request.getParameter("username")%>
    </body>
    </html>

    Consider the lifecycle.
    You request page "index.jsp" It runs index.jsp and produces html. It sets the request attribute "myparameter"
    You request page middle.jsp. It runs middle.jsp.
    Note that this progression requires two seperate requests - one for "index.jsp" and then another for "middle.jsp", which sends the request parameters from the form from your browser to middle.jsp.
    Request attributes only last the life of one request - so when you request "middle.jsp" the request attribute set when running "index.jsp" is not available.
    cheers,
    evnafets

  • Exporting Content of a JSP page into Excel Spread Sheet

    I am trying to export the content of a JSP page into an excel spread sheet. I know this issue had been posted before, but if you any one has the source code of a sample that's working please send it to me at [email protected]
    Your help is appreciated.
    Jamais.

    http://forum.java.sun.com/thread.jspa?threadID=664249

  • File Sender Content Conversion: Help needed

    Hello Experts,
    i need help with file sender content conversion:
    i have a file which looks like this:
    12329460  24.01.09/07:01  167     Y010122851  136086  43300007            E70115  1L2_96_1
    12329660  25.01.09/07:02  157     Y010122851  136086  43390007            E711J5  1L2_96_1
    as you can see 8 fields, separated with whitespaces
    and i want and xml file which looks like this:
    <DT_DATA_FILESENDER>
      <Recordset>
          <Data> 
            <field1>12329460</field1>
            <field2>24.01.09/07:01</field2>
            <field3>167</field3>    
            <field4>Y010122851</field4> 
            <field5>136086</field5> 
            <field6>43300007</field6>
            <field7>E70115</field7> 
            <field8>1L2_96_1</field8
         </Data>
          <Data> 
            <field1>12329660</field1>
            <field2>25.01.09/07:02</field2>
            <field3>157</field3>    
            <field4>Y010122851</field4> 
            <field5>136086</field5> 
            <field6>43390007</field6>
            <field7>E711J5</field7> 
            <field8>1L2_96_1</field8
         </Data>
      </Recordset>
    Would you please let me know how the datatype has to look like?
    And especially how the FCC has to be configured for this scenario?
    Thanks in advance,
    Chris

    > With fixed lengths i get it working,
    >
    > but with de fieldseparator 0X09 it does not work,
    > would you please tell me the complete FCC config not only the fieldSeparation line?
    Well Christian,
    There is one thing, eithere you can use fieldSeparator or fieldFixedLengths you can not use both together. So in your case do not use fieldSeparator.
    The complete FCC is almost same as given in the blog in my previous reply. See the final output in that blog and create your data type accordingly. e.g.
    Recordset
    ------Item 0...unbound
    --------Field1 0..1
    --------Field2 0..1
    --------Field3 0..1
    --------Field8 0..1
    Regards,
    Sarvesh

  • How to display a document content in a JSP page

    Hi friends,
    I am trying to display a document's content in a JSP page after user authentication.For that I mapped a jsp file with extension ".sens" in Content Management SDK manager,and put the file in the directory '/ifs/jsp-bin' of webstarterapp,but it is not working.Please help me to solve the probleb as earliest.
    Regards
    Prasenjit

    under view put a new tag
    <f:view>
    <ui:script url="page.js"/>
    and thats it

  • When i send a PDF file to out side print, some of the things I aded dose not print. Is there a way I can "close" the PDF when i finish the work- so' every thing will be printed for sure

    when i send a PDF file to out side print, some of the things I aded dose not print.
    Is there a way I can "close" the PDF when i finish the work- so' every thing will be printed for sure

    Send Apple feedback. They won't answer, but at least will know there is a problem. If enough people send feedback, it may get the problem solved sooner.
    Feedback
    Or you can use your Apple ID to register with this site and go the Apple BugReporter. Supposedly you will get an answer if you submit feedback.
    Feedback via Apple Developer

  • TRYING TO SEND AN EMAIL VIA JSP not working

    I think what im doing is right but i keep getting errors...therefore...its wrong..
    <form action="mailer.jsp" method="post">
         To :<br>
         <input type="text" name="to" class="std"></input><br>
         From :<br>
         <input type="text" name="from" class="std"></input><br>
         Subject :<br>
         <input type="text" name="subject" class="std"></input><br>
         Message :<br>
         <textarea rows="10" cols="80" name="message"></textarea>
         <br>
         <input type="submit" value="Send"></input>
         </form>Mailer.jsp
    <div class="frame">
         <jsp:useBean id="mailer" class="com.stardeveloper.bean.test.MailerBean">
              <jsp:setProperty name="mailer" property="*"/>
              <% mailer.sendMail(); %>
         </jsp:useBean>
         Email has been sent successfully.
         </div>MailerBean.java
    package com.stardeveloper.bean.test;
    import java.io.*;
    import java.util.*;
    import javax.mail.*;
    import javax.mail.event.*;
    import javax.mail.internet.*;
    public final class MailerBean extends Object implements Serializable {
         /* Bean Properties */
         private String to = null;
         private String from = null;
         private String subject = null;
         private String message = null;
         public static Properties props = null;
         public static Session session = null;
         static {
              /*     Setting Properties for STMP host */
              props = System.getProperties();
              props.put("mail.smtp.host", "mail.brunel.ac.uk");
              session = Session.getDefaultInstance(props, null);
         /* Setter Methods */
         public void setTo(String to) {
              this.to = to;
         public void setFrom(String from) {
              this.from = from;
         public void setSubject(String subject) {
              this.subject = subject;
         public void setMessage(String message) {
              this.message = message;
         /* Sends Email */
         public void sendMail() throws Exception {
              if(!this.everythingIsSet())
                   throw new Exception("Could not send email.");
              try {
                   MimeMessage message = new MimeMessage(session);
                   message.setRecipient(Message.RecipientType.TO,
                        new InternetAddress(this.to));
                   message.setFrom(new InternetAddress(this.from));
                   message.setSubject(this.subject);
                   message.setText(this.message);
                   Transport.send(message);
              } catch (MessagingException e) {
                   throw new Exception(e.getMessage());
         /* Checks whether all properties have been set or not */
         private boolean everythingIsSet() {
              if((this.to == null) || (this.from == null) ||
                 (this.subject == null) || (this.message == null))
                   return false;
              if((this.to.indexOf("@") == -1) ||
                   (this.to.indexOf(".") == -1))
                   return false;
              if((this.from.indexOf("@") == -1) ||
                   (this.from.indexOf(".") == -1))
                   return false;
              return true;
    }

    I think what im doing is right but i keep getting
    errors...therefore...its wrong..i don't see any errors posted, so it must not be wrongThe error occurs because the OP did not use BSD-style braces.

  • ...file Sender content conversion 'lastFieldsOptional'  error

    Hi All,
    I am working on a File Sender content conversion--> flat file to XI.
    it's fixed length field all the rows with same column.
    090627 344535AFDFG+GBP65433 ASDSSD GFD dFSSGFD 6757532
    090627 344535AFDFG-GBP65433 ASDSSD GFD dFSSGFD 6757532
    090627 344535AFDFG-GBP65433 ASDSSD GFD dFSSGFD 6757532
    090627 344535AFDFG-GBP65433 ASDSSD GFD dFSSGFD 6757532
    090628 344536AFDFG+GBP45434 ASDSSD GFD dFSSGFD 6757532
    090628 344536AFDFG-GBP45434 ASDSSD GFD dFSSGFD 6757532
    **EOF**
    I am sucessfully able to handle the file if i remove "**EOF*" from incoming file. But i get "lastfieldsOptional" error with "*EOF**"
    >
    Parameters-
         Recordset Structure - ROW,*
         Recordsets per message - *
        ROW.fieldFixedLengths - 6,8,20,10,30,1,3,1,11,1,11,6,10,10,20,10,10,2,6,6,2,6,6,3
        ROW.fieldNames - INV_DATE,INV_NO,PAYMENT_REF,CUST_NO,CUST_NAME...etc etc
       ignoreRecordsetName - true
    There are parameters available to ignore Last field(last column) of a Row/Rocerdset
    but how to ignore the last row of the file.
    Plz suggest some parameter to ignore the last row/field of the file.
    Regs,
    Ansh

    Ansh,
    .lastFieldsOptional  is obselete and you cannot use. Please see sap help:
    http://help.sap.com/saphelp_nw04/helpdata/en/2c/181077dd7d6b4ea6a8029b20bf7e55/content.htm
    The best thing comes to my mind is use:
    .keepIncompleteFields as YES
    Also give a try with:
    .missingLastfields as add
    So with this I think your last line in the file will read into XI. But the value of last line is **EOF**. So the length is 9. Since your the first two fixed lengths are 6 and 8. You will have these values as ***EOF and ***. So while mapping you can use doesnot satrt with * and map it, so that your last line will be ignored.
    Note: with this apporach you have to make sure your first two columns never start with *. If you have a doubt then you can use the condition doesnot equal to ***EOF for first field and doesnot equal to *** for the second field when you map. I hope it makes sense to you.
    Regards,
    ---Satish

  • Reading a properties file in a servlet and passing its contents to a JSP pa

    Hi all,
    I'm totally new to Servlet pgmg n JSP. Please can ne1 tell how to read a simple properties file (in a servlet) and pass its contents to a JSP page.Actually the reason is to fill a combo box in a JSP page with the contents of a properties file.If calling a servlet for the same is d best way to do that, plz can ne1 tell me :
    1> whether to override the doPost method in the servlet in which to read d file using FileInputStream
    2> Putting the contents in an array and then how to pass this array to the JSP page.
    Thanks,
    deepthy.

    I'm using a properties file to let my web application know what the name of the database is. I'm using an abstract class GeneralDao which will be extended by all the DAO's (Data Access Objects or java classes containing SQL statements).
    Here's the code :
    protected Connection getDatabaseConnection()
              throws Melding
         Connection dbconn = null;     
         ResourceBundle resBundle;
         try
         Class.forName("com.mysql.jdbc.Driver").newInstance();
         resBundle = ResourceBundle.getBundle("gcoConfig");
         String dbConnectie = resBundle.getString("databaseconnection");
         gcoLogger.debug("lezen databaseconnection in resourceBundle " );
         dbconn = DriverManager.getConnection(dbConnectie);
         } catch (InstantiationException exc)The ResourceBundle is used to read the properties file, named gcoConfig.properties.
    With the getString() command I read the content of the string named databaseconnection.
    The gcoConfig.properties file is placed inside the folder C:\Program Files\Apache Software Foundation\Tomcat 5.0\webapps\gco\WEB-INF\classes
    The GeneralDao is placed in the folder C:\Program Files\Apache Software Foundation\Tomcat 5.0\webapps\gco\WEB-INF\classes\org\gertcuppens\cluifDao.
    So this class is placed some folder below the WEB-INF\classes folder of gcoConfig.properties.
    And the content of the properties file is just one line :
    databaseconnection=jdbc:mysql://localhost/cluif
    If you want to let the JSP know what's inside the properties file, wrap the content in a Javabean, put it in the request or even the session and pass the control to the JSP.

  • Problem in message mapping due to file sender content conversion

    Hi all
    basically i m using file sender content conversion and couldn't make file in a proper nested structure where weight was the nested field of detail as there is a limitation of content conversion in file adapter:
    My file came out like this:
    <header>
    </header>
    <Detail>
    </Detail>
    <Weight>
    </Weight>
    <Weight>
    </Weight>
    <Detail>
    </Detail>
    <Weight>
    </Weight>
    <Weight>
    </Weight>
    <trailer>
    </trailer>
    and i wanted it like:
    <header>
    </header>
    <Detail>
    <Weight>
    </Weight>
    <Weight>
    </Weight>
    </Detail>
    <Detail>
    <Weight>
    </Weight>
    <Weight>
    </Weight>
    </Detail>
    <trailer>
    </trailer>
    so now the problem is i want to generate an idoc from it....but theres no way out to determine which weight is related to what detail except that the weight related to detail 1 comes after start and end of detail 1 tag and then weights of second detail comes after start and end of detail 2 tag in my source xml file.
    The structure of the target idoc is
    <header>
    </header>
    <Detail>
    <Weight>
    <flag>D1</flag>
    </Weight>
    <Weight>
    <flag>D1</flag>
    </Weight>
    </Detail>
    <Detail>
    <Weight>
    <flag>D2</flag>
    </Weight>
    <Weight>
    <flag>D2</flag>
    </Weight>
    </Detail>
    <trailer>
    </trailer>
    so i was wondering if i can make a user defined function in which i feed detail and weight and result a flag d1/ d2 inside the tag field. My logic is smth like
    while detail is 1 make all the tag weights coming after detail 1 inside <detail1> tag then resultlist.CC for context change  then while detail is 2 make a loop to fill the weight coming after detail 2 inside the <detail2>
    Is this possible by any means. I really need help
    Thnks
    Naina

    Hi
    My sender file content conversion have this setting:
    HEADER,1,DETAIL,*,Weights,*,TRAILER,*
    And plz give me more idea of the adapter module ....is there any blog available which is related to my problem.
    Naina

  • File sender content conversion

    hello
    I have a txt file sender content conversion in SAP PI.
    I define in the content conversion 6 fields names(field1, field2, field3,field4,field5,field 6) but the fie that I am loading has only three field(field1,field2,field3). the file is still loading though there is a different in the structure between what I define in the PI to what is loading to the PI.
    is there a way to send an error with out loading the file?
    I read about the count function in the mapping. isnt there a build in function that suppose to load only the structure that is define?
    Thanks
    Kfir

    If you define 6 fields and only 3 are present in the test file then you wont get an error (AFAIK)
    However, if you define 3 fields and there are 6 present in the source file then you will get an error saying more number of parameters found.
    isnt there a build in function that suppose to load only the structure that is define?
    I dont think so....this may however be achieved using a custom adapter module.
    Update:
    Just remembered that SAP PI (7.1 and above) comes with inbuilt XML-validation function....check if that helps in your design.
    Regards,
    Abhishek.
    Edited by: abhishek salvi on Dec 15, 2010 1:12 PM

  • Challenge in File Sender Content Conversion

    Hi,
    I have a real challenge concerning File Sender content conversion in SAP XI.
    My flat file looks like this:
    ##H   300
    MAR   206
    KAS 1
    DAT 01.03.08
    ART 1.129
    KUN 118
    EAN 4.499
    REL 5.0j 16.05.06
    SER             1
    ##E   300
    ##H   301
    DAT 01.03.08
    ZEI 07:54
    KAS 1
    ##E   301
    Each row represents a data field and has two values: The first one defines the field name, the second represents the field value. E.g. 'DAT' stands for Date and has the value 01.03.08 in the example.
    The fields belonging together in one data set are enclosed by a start qualiefier (##H)and an end qualifier (##E).
    The value after these qualifiers (i.e. '300' and '301' in the example above) represent a certain record type, e.g. '300' represents Customer data and '301' represents Account Data.
    Is it possible with file content conversion to create the following XML structure:
    <?xml version="1.0" encoding="UTF-8"?>
    <ns0:MT_DATA xmlns:ns0="http://sap.com/xi/account">
         <300>
              <MAR>206</MAR>
              <KAS>1</KAS>
              <DAT>01.03.08</DAT>
              <ART>1.129</ART>
              <KUN>118</KUN>
              <EAN>4.499</EAN>
              <REL>5.0j 16.05.06</REL>
              <SER>1</SER>
         </300>
         <301>
              <DAT>01.03.08</DAT>
              <ZEI>07:54</ZEI>     
              <KAS>1</KAS>
         </301>
    </ns0:MT_DATA>
    If it is not possible with content conversion, what could be an alternative? Adapter Module? MultiMapping?
    I'd really appreciate your input as I am working on this since several days without a solution.
    Thanks in advance.
    Alex

    It is not possible thru adapter..
    There is one blog to convert such files to XML sing java mapping. Search for any flat file to Idoc or xml in the forum.
    VJ

  • Sender content conversion parameters

    what wld be the sender content conversion parameters for the following structure?
    MessageType        1-1
        Records            1-1
           File                1-unbounded
    thanks

    Hi,
    If you have not come across:
    http://help.sap.com/saphelp_nw04/helpdata/en/e3/94007075cae04f930cc4c034e411e1/frameset.htm
    would be of help.
    Regards,
    Manjusha.

  • How to send an email in jsp

    hei evryone!
    can anyone pls help me on how to send an email in jsp. I mean i have a webpage wherein you submit data , upon submission or after the submit button is clicked i need to send an email to a person regarding the data sumitted on the form , i dunno how to do this, can anyone please help me on how to use Javamail, or can anyone post a sample code or site of a tutorial .. thx!

    There are some quite good examples on the use of Javamail on the Sun website. No, we're not going to write your application for you, unless you're willing to pay consultancy fees in real money.
    http://java.sun.com/products/javamail/index.jsp
    http://java.sun.com/products/javamail/FAQ.html
    http://java.sun.com/products/javamail/reference/techart/index.html

  • How can I send a file that CAN NOT be printed or saved by the recipient?

    How can I send a file that CAN NOT be printed or saved by the recipient?

    Impossible. PDF files don't stream, so they cannot be opened until they've been saved.
    You can truly prevent printing by using DRM, or ask nicely by using a permissions password (though that's ignored by non-Adobe software).

Maybe you are looking for

  • How do you access a web service to insert data into table?

    Ok I have a simple html/jsp survey form to host on our web site. Because of firewall issues I cannot do a direct connect to the database and insert the data from the form. So I need to take the data from the survey form, and pass it to an existing we

  • Downloads will not install

    It seems that when I download certain files or software, I cannot open them in order to install the file. It will download to my desktop and when I go to open it a large text file will open containing pages of odd characters and words. How do I open

  • PR05 Credit card data Buffering issue

    Hello, I have an issue with Credit card data. I guess problem is with document buffering. Here is the information.. I am using Tcode PR05 (Travel Expense Manager) for US travel & expenses. TRVPA CCC is set to 4. I have selected credit expense data to

  • List of Cheque Printing

    Dear All, Business using T-code F-58 to post out going payments to vendors, here posting is done in one place and cheque printing will be done in another country. 2. Is there any report to see the list of cheques pending for print out.  T-code SP02 h

  • Can I use return table in non-cumulative cubes upd rules?

    hi, Is it possible to use return table in non-cumulative cubes upd rules? What I mean is: In non-cumulative cubes I need to use Automatic Time Conversion for time chars and when I use return table I have to map fields from comm structure to return ta