How to print report from JSP Page

Hi Everybody,
I am developing a simple project in JSP with MS Access. I hav some tables and reports for them. I hav a JSP page which gets inputs from user and save it in the table. Its working fine. But my problems are,
1) I hav a button called "SAVE & PRINT" in that bottom of the page, if i click that button, the currently entered data has to save in the table and the same data has to print from the MS Access report. I dont know how to print this report from JSP page.
2) Another button called "REPRINT". If i click that button, it has to ask a number to print the report page, that number is nothing but a field in that report.
Could anyone help me to solve this problem.

Hi Everybody,
I am developing a simple project in JSP with MS Access. I hav some tables and reports for them. I hav a JSP page which gets inputs from user and save it in the table. Its working fine. But my problems are,
1) I hav a button called "SAVE & PRINT" in that bottom of the page, if i click that button, the currently entered data has to save in the table and the same data has to print from the MS Access report. I dont know how to print this report from JSP page.
2) Another button called "REPRINT". If i click that button, it has to ask a number to print the report page, that number is nothing but a field in that report.
Could anyone help me to solve this problem.

Similar Messages

  • How to print report in jsp page?

    excuse me,i am new to jsp
    may i know how to pritn report in jsp page or html?
    tq

    here is a hacked up example.. i ripped out a lot, so it may not compile, but you get the idea... the full version is really long and not much new info.. just all awt/display stuff...
    package rowe;
    import javax.swing.*;
    import java.util.*;
    import java.awt.*;
    import java.awt.image.*;
    import java.awt.event.*;
    import java.sql.*;
    import utility.*;
    import java.awt.print.*;
    public class rowePrint extends JFrame implements ActionListener, Printable{
         String printType = "";
         static JButton j = new JButton("Print");
         FontMetrics fm;
         String jID, promotion, product, jComments;
         public void getInfo(int jid) {
              ResultSet rs;
              try {
                   Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
                   Connection conn = DriverManager.getConnection("jdbc:odbc:rowe");
                   Statement stmt = conn.createStatement();
                   rs = stmt.executeQuery("select j.id as jID, j.comments, p.title as pTitle, p.product, p.packagingCartonCost, p.foldingQuarterCostPerM, p.foldingQuarterCostPerM, j.customizationOption as setupFee, p.perMcost, p.qtyCarton, d.name as dName, d.contact as dContact, d.email as dEmail, d.address as dAddress, d.city as dCity, d.state as dState, d.zip as dZip, d.phone as dPhone, d.fax as dFax, r.name as rName, j.totalQty, j.orderIn, j.estFreight, j.miscCost, j.coverSelection, j.imprintSelection from jobs j, promotions p, dealers d, reps r where j.promotion = p.id and j.dealer = d.id and j.rep = r.id and j.id = " + jid);
                   rs.next();
                   jID = rs.getString("jID");
                   jComments = rs.getString("comments");
                   promotion = rs.getString("pTitle");
                   product = rs.getString("product");
              } catch (Exception e) {
                   System.out.println("getinfo: " + e);
       public void actionPerformed(ActionEvent e) {
            if (e.getSource() instanceof JButton) {  
                   wookie();
         public void wookie() {
              PrinterJob printJob = PrinterJob.getPrinterJob();
              Paper paper = new Paper();
              PageFormat page = new PageFormat();
              paper.setImageableArea(0, 0, 600, 780);            
              page.setPaper(paper);
              printJob.setPrintable(this, page);
              try{
                   //printJob.pageDialog(page);
              //     if (printJob.printDialog()) {
                        printJob.print();
              } catch (Exception e) {
                   System.out.println("wookie1" + e);
         public static void main(String[] args) {
              rowePrint at = new rowePrint("Invoice");
              at.getInfo((new Integer(args[0])).intValue());
              at.drawShapes();
         //     at.wookie();
         public void drawShapes() {
              setBounds(0, 0, 670, 550);
              addWindowListener(new WindowAdapter() {public void windowClosing(WindowEvent e) {System.exit(0);}});
              j.setBounds(10, 10, 10, 10);
              j.addActionListener(this);
              getContentPane().setLayout(null);
              getContentPane().add(l);
              getContentPane().add(j);
              show();
         public rowePrint(String s){
              printType = s;
         public void paint(Graphics g) {
              g.setFont(new Font("Serif", Font.BOLD, 18));
              g.drawString(promotion, 20, 30);
              g.setFont(new Font("SansSerif", Font.PLAIN, 4));
              g.drawString("" + new java.util.Date(), 20, 37);
              g.setFont(new Font("Serif", Font.BOLD, 21));
              g.drawString("Rowe Furniture", 440, 35);
              g.fillRect(440, 40, 145, 25);
              g.setColor(Color.white);
              fm = g.getFontMetrics(new Font("Serif", Font.BOLD, 21));
              g.drawString(printType, 512 - (fm.stringWidth(printType) / 2), 60);
        public int print(Graphics g, PageFormat pf, int pi) throws PrinterException {
            if (pi >= 1) {
                return Printable.NO_SUCH_PAGE;
              paint(g);
            return Printable.PAGE_EXISTS;
    }

  • How to call RDF report from JSP page

    Dear all,
    I want to call a RDF report from JSP page. I am creating the JSP page using j developer 10G.
    Can anyone help me out in this case. Is there any tag or procedure or any other way by of that i can perform this work.
    please help and send the reply on [email protected],[email protected]
    thanks
    Ashok

    Hi Ashok,
    You can use rwservlet - nothing really to do with JDeveloper. Once you have report server up and running (hint: read http://download-uk.oracle.com/docs/cd/B14099_19/bi.1012/b14048/toc.htm), you can call a report like this:
    http://server:port/rwservlet?report=my_report.rdf&destype=cache&desformat=html&p_my_parameter=xxx etcHope this helps,
    John

  • How i start printing report from 2nd page

    When Press on Print button to print report, then it start from 1 page.
    Is it possible that report start printing from the 2nd page....
    Plz help if possible...
    Thanks alot..

    hi dear,
    I think wht u do is place a "Form feed" char on the first line of your report
    and make sure it has property "print object on" set to "first page"
    so as and when u startyour printing it will make a form feed and your first page will
    be printed with nothing and print starts from 2nd page....
    Enjoy Oracle...

  • Launching a Discoverer report from jsp page

    Hi
    I have a discoverer workbook created using BI Discoverer (for relational). I want to accept some parameters for this workbook from a jsp page, which will also have a "View report" button. This button when pressed should open up the Discoverer workbook and all the parameters from the jsp should be passed to the workbook.
    Is it possible? If yes, any details on it?
    We do the same thing successfully to launch Oracle Reports from jsps, we simply build the url in the jsp, and from jsp we submit it to a new window, and it opens up the report. Similar functionality we are looking to launch Discoverer reports.
    Any help will be appreciated.
    Thanks
    Shalu

    You can open the workbook with URL parameters with Discoverer Viewer much like you would Oracle Reports. Setting anything form the username, password, workbook name, worksheet, and parameters. All the information can be found in the following document:
    http://download-east.oracle.com/docs/cd/B14099_11/bi.1012/b13918/urlstart.htm
    The specific question your asking is addressed under 13.5.2 Example 2. Let me know if you have any issues
    Matt Topper
    Technical Management Consultant
    TUSC, The Oracle Experts
    [email protected]

  • How to call Servlet from jsp page and how to run this app using tomcat..?

    Hi ,
    I wanted to call servlet from jsp action i.e. on submit button of JSP call LoginServlet.Java file.
    Please tell me how to do this into jsp page..?
    Also i wanted to execute this application using tomcat.
    Please tell me how to do this...? what setting are required for this...? what will be url ..??
    Thanks.

    well....my problem is as follows:
    whenever i type...... http://localhost:8080/appName/
    i am getting 404 error.....it is not calling to login.jsp (default jsp)
    but when i type......http://localhost:8080/appName/login.do........it executes servlet properly.
    Basically this 'login.do' is form action (form action='/login.do').....and i wanted to execute this from login jsp only.(from submit button)
    In short can anyone please tell me how to diaplay jsp page using tomcat 5.5
    plz help me.

  • Hi how can print report     from form directly

    Hi,
    I would like to print report from D2k directly....
    i.e. suppose we pressed a button report has to be generated and printed automatically.... Generating of report is done by Run_product function, but how to give print directly...
    please u send ur valuable suggestions to my mail id also
    [email protected]
    bye!

    When calling the report from form, include 2 more parameters in the parameter list:
    - PARAMFORM=No
    - DESTYPE=Printer
    hth

  • Submitting a XML Publisher Report from JSP page

    Hello,
    We have need to submit a XML Publisher report from Quoting/iStore module in Oracle Ebusiness. The out put should be viewable in PDF format and user should be able to print. can anyone pls help on how this can be achieved.
    TIA

    Really appreciate your response. Can you pls give little more details.
    1] Are there any standard API's which I can use to submit XML publisher report from the JSP pages
    2]Is there any sample code snippet for any of the options that I can refer to..or pls let me know the API's, I will check on them
    Appreciate any help

  • How to send info from JSP page as email-body

    Hi,
    i have a JSP page that generates dynamically as a result of some query. I have a Button - "Send Email".
    I want to send the information to the receipient thru email automatically on a button click,
    All information is in the memory. How can we pick the info from memory and send it as a message thru email?
    Pls help.
    thanx & regards,
    Shalini

    create a servlet to send mail (use the JavaMail api) then Post the message to the servlet when you click on the button.
    OR, put the message and any other data (like the email address) into the session, and then just call the servlet on click of the button, and have the servlet retrieve the information from the session.

  • How to print report From Oracle form directly on printer

    Hi,
    I am running report from form and output should be directly printed on printer.
    Database: 11g Release2
    Forms version : 11.1.2
    Report version : 11.1.2
    OS: windows 7 professional 32 Bit
    Written following code:
    declare
    pl_id ParamList;
    varno number;
    x VARCHAR2(150);
    y NUMBER;
    repid REPORT_OBJECT;
    v_rep VARCHAR2(100);
    begin                
    pl_id := Get_Parameter_List('tmpdata');
    IF NOT Id_Null(pl_id) THEN
    Destroy_Parameter_List( pl_id );
    END IF;
    repid := FIND_REPORT_OBJECT('SALEBILLNEW'); -- report object name
    pl_id := Create_Parameter_List('tmpdata');
    Add_Parameter(pl_id,'copies',TEXT_PARAMETER,'1');
    Add_Parameter(pl_id,'background',TEXT_PARAMETER,'Yes');
    Add_Parameter(pl_id,'mode',TEXT_PARAMETER,'Character');
    Add_Parameter(pl_id,'printjob',TEXT_PARAMETER,'YES');
    Add_Parameter(pl_id,'VCOMPANY',TEXT_PARAMETER,:block50.coname);
    Add_Parameter(pl_id,'VCOde',TEXT_PARAMETER,:block50.code);
    Add_Parameter(pl_id,'VOURBILLNO',TEXT_PARAMETER,:BLOCK50.FROMBILL);
    Add_Parameter(pl_id,'PARAMFORM',TEXT_PARAMETER,'NO');
    Add_Parameter(pl_id,'DESTYPE',TEXT_PARAMETER, 'PRINTER') ;
    Add_Parameter(pl_id,'DESNAME',TEXT_PARAMETER, 'OKI MICROLINE 391 TURBO (COPY1) on NILESH-PC') ; --default printer name
    SET_REPORT_OBJECT_PROPERTY(repid,REPORT_COMM_MODE,SYNCHRONOUS);
    SET_REPORT_OBJECT_PROPERTY(repid,REPORT_EXECUTION_MODE,RUNTIME);
    SET_REPORT_OBJECT_PROPERTY(repid,REPORT_DESTYPE,PRINTER);
    SET_REPORT_OBJECT_PROPERTY(repid,REPORT_SERVER,'rep_adminserver_inorasrv-pc_asinst_3');
    y := LENGTH ('rep_adminserver_inorasrv-pc_asinst_3') + 2;
    x := RUN_REPORT_OBJECT (repid, pl_id);
    WEB.SHOW_DOCUMENT('http://inorasrv-pc:7001/reports/rwservlet/getjobid'||SUBSTR(x,y)||'?server=rep_adminserver_inorasrv-pc_asinst_3&userid=scott/tiger@winorasr');
    Destroy_parameter_list('tmpdata');
    end;
    Above code giving following error:
    REP-52251: The output of job ID 111 requested on Thu Oct 18 18:37:20 IST 2012 cannot be retrieved.<P>REP-51026: No output is generated for job 111.
    Need help..
    Thanks in advance.

    Hi,
    I have change the printer name to OKI
    Add_Parameter(pl_id,'DESNAME',TEXT_PARAMETER, '\\Nilesh-pc\OKI') ;
    Add_Parameter(pl_id,'DESFORMAT',TEXT_PARAMETER, 'dflt.prt');
    SET_REPORT_OBJECT_PROPERTY(repid,REPORT_DESNAME,'\\Nilesh-pc\OKI');
    SET_REPORT_OBJECT_PROPERTY(repid,REPORT_DESFORMAT,'dflt.prt');
    code which i have posted above unable to reach at default printer and gives following error
    The report generated successfully but distribution to destinations failed.
    Modified above code to take default printer from registry.
    Added below code
    rtn_Registry := CLIENT_WIN_API_ENVIRONMENT.Read_Registry('HKEY_CURRENT_USER\Software\Microsoft\Windows NT\CurrentVersion\Windows','Device');
    rtn_defaultPrinter := substr(rtn_Registry,1,instr(rtn_Registry,',',1)-1);
    Add_Parameter(pl_id,'DESNAME',TEXT_PARAMETER, 'rtn_defaultPrinter') ;
    It is giving error
    CLIENT_WIN_API_ENVIRONMENT.Read_Registry must be declare.
    Edited by: parapr on Oct 20, 2012 10:47 PM

  • How to catch ClassCastException from JSP page?

    I get a ClassCastException within my JSP page and I know where my bug is. However, this classcastexception message is displayed in the browser and I want to catch this exception to also log it into my log file. But I can't find the place where to catch it: in my servlet's doPost() method I can't catch it - i tried it by enclosing the method body with try/catch but it isn't catched. I wonder if I can catch it at all or if this error is handled internally in the servlet engine?

    It should only be displayed in the browser if you're not catching the exception in the jsp itself. If the exception is happening in the jsp, then there's no point in trying to catch it in the servlet.
    What happens if you put a try-catch just around the actual code in the jsp? You could put it around the entire jsp, but that's not necessary.
    One problem I've encountered in catching exceptions is if there are escape sequences within the try block, for example:
    try{
       //java code
    %>
       <!--html -->
    <%
    //java
    catch (Exception e)I'm not sure if that works or not, but to be safe, make sure you're not escaping from jsp within the try block.

  • How to run servlet from JSP page

    A simple JSP page,where I will put a button.And on clicking..it will invoke the servlet and the servlet will send the result to the jsp page...
    Please give the instructions with examples...
    Thanks in advance...

    hi,
    Create a jsp inside webapps/root
    <a href="./howtocode" > click to call servlet </a>and follow the steps
    http://forum.java.sun.com/thread.jspa?threadID=5202830

  • How to call reports from JSP/HTML application

    Hi,
    We have a web application developed in JSP, I'd like to use Oracle Reports writer to generate reports (Since our back office application is developed using Oracle forms and Reports - 6i).
    I don't know how to place a request to Oracle Reports server and view the output. Can someone please help me with this.
    Thanks in advance.
    Best Regards,
    Karthik

    Hello Karthik,
    You have a web application developed in JSP. In that you are calling Reports though URL through your JSP.
    User views the source of the HTML page, in browser which is the result of execution of JSP. So Client will see the
    HTML output, but not the real JSP.
    Still if you donot want to hard code the user/password in file, have a form and ask client to enter user/password.
    Or you can combine your JSP with other Java components , like Java bean or Servlets to get user/password at run time.
    With Regards
    Sachin

  • How to print report from print server ?

    Hi all,
    I need to print the report where the printer are shared by group of people which is located at server. I have put in the path in DESNAME = \\192.168.1.239\plc6 where \\{my printer ip address}\{printer name}
    however, when I run the report, in the report viewer the printer name is still defaulted as what I have defaulted printer in my printer setup whereas the printer that I specific in the report which is located at server was not selected and again the report was printed out based on what my PC has been defaulted. My question it's anything wrong with my path ? why the report was not printed out based on the printer on the desname ?
    Please advise. Thanks.
    Lim

    You can use FOP, but the formatting of the xsl (Xml Style Sheets) takes a little work. If you have the Oracle Reports server up and access to the development product, why not go that route?
    You want the filtering and sorting and searching, yes, but then you also want to print them out.. Then you would probably be best looking at replacing the Oracle Reports setup with BI Publisher. You can convert Most your reports over to bi publisher layouts easily.. (I have heard of some reports that do require recreating in Bi Publisher from Oracle Reports..)
    Then you can have your Apex Reports and call Bi Publisher from APEX and everyone wins..
    Is your Oracle Reports stuff used by non-APEX applications, that could be modified to use Bi Publisher?
    Thank you,
    Tony Miller
    Webster, TX

  • How to call cystal report8 report file from jsp page

    hi guys
    present i am using cystal report8 already i am having ReportViewer.jar and ReportviewerBean.jar files
    using that please send me sample code how to call that report from jsp page..
    and how to pass the parameters from jsp page to crystalreport8 report file.
    it was very urgent task to me..so please send sample code on above topic..
    or send me crystalreport8 API
    thanks
    regards

    Hi,
    I also want to work on crystal report but i dont have the ReportViewerBean.jar and ReportViewer.jar. So, please tell from where will i get those jar files.
    Thanks in advanced.

Maybe you are looking for

  • Error R6034 during update. iTunes will not open due to error.

    Get Error R6034, Application attmempting to load C runtime library incorrectly.  iTunes will not install ammanulaly and now iTunes will not open due to error.

  • DAC, ETL failed due to Post-Etl Script not exist and table not exist.

    When execute the ETL in DAC, it failed when execute the "Change Capture For Siebel OLTP" encounterred the following two type errors. how to fix these errors? The first is the table not exist: ==========================================================

  • Non-functioning Firewire ports

    Help...! I have a MacPro hooked up to an Apple 23in display. With the display's multi-plug attached to the rear FireWire port, the front FireWire port doesn't work, nor to the ports on the display. The USB ports work perfectly. The FW ports are obvio

  • Hi error for profit center feild reuired entry

    Hi experts, My client has been asked to us,profit center as a reuired feild at the transaction stages. For this we made profit center as required feild at the feild status grioup level. After this one of my sd consulatant trying to post accounting do

  • Response email address is different from my offici...

    I've responded to an email from BT which has an incident number.  My reply got an automated response saying it had come from an unrecognised email address. My email address is in the format *@btinternet.com, but when I reply the system replies from *