Print HTML from Popup

Hello!
I have a Problem. I would like to print the HTML Content of a Popup using the recommandations from http://download.oracle.com/docs/cd/E17904_01/apirefs.1111/e12419/tagdoc/af_showPrintablePageBehavior.html
But when I klick the Print Button I get the Content from the Page in Background and not from the Popup. Has somebody an Idea how I could resolve this?
Thank you!

You can use below javascript
<af:resource type="javascript">
function openWindow(printEvent){
self.print();
</af:resource>
<af:clientListener method="openWindow" type="load"/>
The above code will popup print window with form load. you can call the javascript with button click.

Similar Messages

  • ___Advice on how to print html from an applet___

    I have been working on this problem for a little while, but still can't find a good solution. I ask for any help/advice I can receive on this matter.
    Below is what I have already tried:
    1) Place the HTML within a JEditorPane and print the graphics object.
    * In order to do this I would have to display the HTML, which I do not want to do.
    * I have also tried placing the HTML within a JEditorPane and not display it, but I get no data from printing the graphics object.
    2) Print the View classes that contain the text by placing the html into a JEditorPane ex) JEditorPane.getUI().getRootView(jeditorPane).
    * This method is how the following article prints HTML: http://www.fawcette.com/javapro/2002_12/online/print_kgauthier_12_10_02/
    * This class prints each "leaf" view, which unfortunately will not print lists or table borders b/c they are contained in "branch" views. I have not been able to convert this class to print the branch views in a nice looking format.
    3) Use a DocFlavor of type "text/html" and send document to the printer.
    * Some printers can render html, but these are few and far between. Most printers I am dealing with do not accept type text/html.
    Below are some things I am thinking about trying:
    1) Convert the HTML to postscript and print the postscript.
    * I have no clue how to do this. I have searched the internet for code and found nothing but perl code (but I am using a java applet).
    2) Save the html file to users disk and open html file in new browser window. Then use javascript print function.
    * I really do not want to have to save files to the users disk just to print. This seems like the easiest way, but is also the least user-convient way.
    I would greatly appreciate any advice on printing HTML using java. Should I re-examine the methods I already tried? Can anyone give input on the methods I am planning to try? I would think this is a common problem, but I am having a hard time finding answers.
    Thanks for your interest and any help you can provide :)

    I tried the Java printing API in 1.4.2 but found it hopeless in terms of printing anything without using AWT.
    Also since the print service was going to be on Windows machine I used jawin (http://sf.net/projects/jawinproject/) to query the registry for the command to print a particular extension and then exec that command.

  • Printing HTML from AIR app

    What are the general rules to print an html content from an AIR application to make sure that the printout looks the same as printing it from the browser?
    Thanks

    Hi,
    This link might help you:
      http://dryicons.com/blog/2008/04/26/multiple-page-printing-from-a-html-adobe-air-applicati on/
    Thanks and Regards,
    Kanchan Ladwani | [email protected] | www.infocepts.com

  • Print HTML from Java

    Hello All,
    can anyone please provide example code of how to print an html-file from localhost by Java-code ?
    Thanx a lot !!

    Not sure what you are asking. You've mentioned several different things.
    One is printing - do you mean to put something on paper? There should be examples on how to print a file if you do a search.
    The other is 'from localhost' - this implies a socket to connect to 127.0.0.1 - Does your code connect to an HTTP server, issue a HTTP GET for an HTML page?
    Again there should be sample code for connecting to a server and reading the response if you do a search.

  • Printing HTML from a JEditorPane

    Hi, I wish to print out HTML which has been rendered by a JEditorPane. I have very little experience with printing in java and have so far failed to get a print to work either due to the code being processed and nothing happening or due to exceptions.
    Is it possible to use the print service to print out an HTML file (in rendered form)?
    If anyone knows any way of printing out HTML (either from a printservice viewpoint or via a JEditorPane) please post a code example as all my coding has been unsuccessful.
    Thank you.

    A recent article in JavaPro has a nice solution for this problem. Check out
    http://www.fawcette.com/javapro/2002_12/online/print_kgauthier_12_10_02/
    It describes a way of using Views to break down the pages.

  • Print html file with barcode from abap report

    hi
    i am printing html file from abap program using gui_execute.
    i am using netscape.exe , its printing first time and when reprint its not working
    basically html file contains gif file which has fedex barcode.
    could you please let me know how to print html file from report

    DGU wrote:
    where to check RAW or TEXT? the print report vi only asks for file name and printer name.
    When I print from notepad, everything just goes by default. This is a label printer, so I never need to specify printing parameter such as size, orientation, etc in the past
    Famous last words go something like this: "...never had to do that before."  Maybe you have to do that now.  It's worth at least comparing the defaults settings for bothe generic drivers.  It could save you a lot of headache if you notice something different.
    Bill
    (Mid-Level minion.)
    My support system ensures that I don't look totally incompetent.
    Proud to say that I've progressed beyond knowing just enough to be dangerous. I now know enough to know that I have no clue about anything at all.

  • Urgent help --  Printing HTML Content to printer from servlet

    I am wanting know if there is a way to Print Reports from servlet.I have some idea about JPS API but it shows some errors on printer services. Pls help me, if any onme having sample code mail to me [email protected]
    I want to print a html content to printer.

    Use the JavaScript window.print() function to print out the current window. However used the HTML LINK tag it can print out a report generated by a servlet without displaying the contents of the report in the browser window.

  • How to issue print command from report/form server to client printer on web

    1) We have a client server application which is to be deployed on the web environment. The reports generated in our application are having a destination type as File. These reports are printed after applying some print format (escape sequences) which are passed on to the printer programmatically at runtime while printing.
    Now when this application is shifted on to the Application server (Forms server & Reports Server )in web environment ,the report outputs would be generated in the application server as against the client in client server environment as the report server is on the application server.
    Now while printing/accessing the report the output file will not be available to the client unless it is pushed on to the client side from the server . I am able to see reports in pdf/html output but in this case layout of my reports gets changed and I dont want to change my layouts or reformat my report layouts.
    How do I redirect the report output from the application server on to the client within the D2k context and then execute print commands?
    Note: In this case we want to use both DMT and Laser printing. Also note that we use escape sequences to adjust reports in desired printing papers.
    2) We have second set of reports which we call as document because these are printed after capturing data from 'Form' using text_io utility (please note that for these documents we are not using any Report 6i functionality)and we print it from file using printing mechanism as mentioned above. These are working well in client server application. We adopted this methodology for getting better performance (in terms of speed as database server and network traffic is not involved) of printing. But now we are converting our application for web, we are finding it difficult how to capture Form's data from browser to client's machine and then executing printing commands which are stored in our application liabrary.
    If you help me out by giving some suggestions, I shall be grateful to you.
    null

    Hello
    I wonder if you ever solved this problem.
    I have a very similar problem with Photoshop CS5 on Mac OSX 10.6 + HP Photosmart C7180.
    If I choose "Photoshop Manages Colors" the results are lousy.
    If I choose "Printer Manages Colors" the results are OK. not necessarily great.
    I believe I have all the correct settings after going through books and web advice (and wasted a lot of paper and ink).
    As far as I can see, "ColorSync" is the internal Mac management which is the only option available with "Photoshop Manages Colors" and "Vendor Matching" appears to mean the printer vendor (ie HP) will provide the matching. Either can be selected if "Printer Manages Colors" is used. It seems the type of paper can be set in three different places. if That's all a bit academic as the results are poor regardless.
    My wife suggests I buy a new printer - Epson's looking good.
    Any words of wisdom would be appreciated.

  • Print HTML Report Automatica​lly after Each UUT

    Hello
    I saw the document on NI site called "Print HTML Report Automatically after Each UUT". That's exactly what I want to do with XML files. So I put it in my sequence file and it works fine, but when it opens the xml file at the first step, there's a pop-up from IE who say that "Scripts are generally safe, do you want to authorise this script" (This message is also displayed when I open my file in files explorer).
    So, the print is not automatically anymore as I must answer to this pop-up. does anybody has a solution to bypass this pop-up ?
    I tried to use the property silent on the class IWebBrowser2. Inded, the pop-up doesn't appear anymore, but my XML file isn't correctly printed. I supposed the default response of the pop-up (which is no) is applied. So the script isn't executed.
    I also tried to configure IE to not display this pop-up : No result
    Regards
    Laurent

    Hello,
    I think that you need to configure your browser, can you take a look a this article:
    http://www.maxi-pedia.com/scripts+are+usually+safe​+do+you+want+to+allow+scripts+to+run
    Regards,
    Nacer M. | Certified LabVIEW Architecte

  • I'm trying to print  an Ancestry document from an iPad 2 using air print onto a Canon 5350 (one of the printers ok'd by Apple) I am unable to change the print orientation from portrait to landscape.  That is I change it in printer settings but no use.

    I'm trying to print an Ancestry document from an iPad 2 using air print.  The printer is a Canon MG5350 (on the Apple approved list) I have no difficulty printing but only in portrait format.  I've tried changing printer preferences from my computer but even though the Canon accepts the changes it will not print landscape - can anyone advise please?

    Hi,
    How do you connect the printer to the XP machine ? If USB, you need to make that machine as a Print server. Please try this:
       http://techtips.salon.com/make-windows-computer-pr​int-server-11914.html
    Regards.
    BH
    **Click the KUDOS thumb up on the left to say 'Thanks'**
    Make it easier for other people to find solutions by marking a Reply 'Accept as Solution' if it solves your problem.

  • Problems with  print range from 1 to 9999 during printing

    Hi All,
    In my project i am printing the datas in a JTable by a click of the button.I have used the following link:-
    http://developer.java.sun.com/developer/onlineTraining/Programming/JDCBook/advprint.html
    to print that data from the JTable.The main problem i have is that
    1) The font size in which the tableheader and tabledatas printed are so small.So that i need to increase the font size for both tableheader and tabledatas?
    2)When i click the printButton for printing it opens a dialog box showing print range from 1 to 9999. And in the pages from 1 to 9999.
    I don't want this.I want only 1 to 1.I know that by using Pageable
    interface u can change it.But i don't know how to do it
    Any one help me to solve this 2 problems i will be very thankful to u.It is Urgent.For ur reference i will provide my Code:-
    import javax.swing.*;
    import javax.swing.table.*;
    import java.awt.print.*;
    import java.util.*;
    import java.awt.*;
    import java.awt.event.*;
    import java.awt.geom.*;
    import java.awt.Dimension;
    import java.io.*;
    public class PrintReportPanels extends JPanel implements Printable
    JTable tableView;
    String aLine="";
    DefaultTableModel model;
    Vector columnNames = new Vector();
    Vector data = new Vector();
    JScrollBar jsb = new JScrollBar(JScrollBar.HORIZONTAL);
    JScrollBar jsb1 = new JScrollBar(JScrollBar.VERTICAL);
    JPanel southPanel=new JPanel();
    JPanel printPanel=new JPanel();
    JButton printButton=new JButton();
    int v=ScrollPaneConstants.VERTICAL_SCROLLBAR_AS_NEEDED;
    int h=ScrollPaneConstants.HORIZONTAL_SCROLLBAR_AS_NEEDED;
    private Font fnt=new Font("Arial",Font.PLAIN,20);//Not working for increasing the font size
    public PrintReportPanels()
         try
    this.setLayout(new BorderLayout());
    UIManager.put("ScrollBar.track",Color.red);
    UIManager.put("ScrollBar.thumb",Color.blue);
         FileInputStream fin = new FileInputStream("Spooler.txt");
         BufferedReader br = new BufferedReader(new InputStreamReader(fin));
         // extract column names
         StringTokenizer st1 = new StringTokenizer(br.readLine());
         while( st1.hasMoreTokens() )
         columnNames.addElement(st1.nextToken());
         }               // extract data
         while((aLine = br.readLine())!=null) //br.readLine() which contains the Spooler.txt datas is assigned to aLine
         StringTokenizer st2 = new StringTokenizer(aLine);
         Vector row = new Vector();
         while(st2.hasMoreTokens())
         row.addElement(st2.nextToken());
         data.addElement( row );
         br.close();
         catch (Exception e)
              e.printStackTrace();
    model = new DefaultTableModel(data,columnNames);
    tableView = new JTable(model);
    JScrollPane jsp = new JScrollPane(tableView);
    this.add(jsp,BorderLayout.CENTER);
    this.add(jsb,BorderLayout.SOUTH);
    this.add(jsb1,BorderLayout.EAST);
    this.add(southPanel,BorderLayout.SOUTH);
    southPanel.setLayout(new FlowLayout());
    ImageIcon ic=new ImageIcon("print.gif");
    printButton.setIcon(ic);
    printButton.setBackground(Color.white);
    printPanel.setLayout(new FlowLayout(FlowLayout.LEFT));
    printPanel.add(printButton);
    southPanel.add(printPanel);
    this.validate();
    this.repaint();
    printButton.addActionListener( new ActionListener(){
    public void actionPerformed(ActionEvent evt) {
         PrinterJob pj=PrinterJob.getPrinterJob();
         pj.setPrintable(PrintReportPanels.this);
         pj.printDialog();
         try{
              pj.print();
         }catch (Exception PrintException) {}
    public int print(Graphics g, PageFormat pageFormat,int pageIndex) throws PrinterException
         Graphics2D g2 = (Graphics2D) g;
         g2.setColor(Color.black);
         g2.setFont(fnt);
         int fontHeight=g2.getFontMetrics().getHeight();
         int fontDesent=g2.getFontMetrics().getDescent();
         //leave room for page number
         double pageHeight = pageFormat.getImageableHeight()-fontHeight;
         double pageWidth = pageFormat.getImageableWidth();
         double tableWidth = (double) tableView.getColumnModel().getTotalColumnWidth();
         double scale = 1;
         if (tableWidth >= pageWidth) {
              scale = pageWidth / tableWidth;
         double headerHeightOnPage=
    tableView.getTableHeader().getHeight()*scale;
         double tableWidthOnPage=tableWidth*scale;
         double oneRowHeight=(tableView.getRowHeight()+
    tableView.getRowMargin())*scale;
         int numRowsOnAPage=
    (int)((pageHeight-headerHeightOnPage)/oneRowHeight);
         double pageHeightForTable=oneRowHeight*numRowsOnAPage;
         int totalNumPages= (int)Math.ceil((
    (double)tableView.getRowCount())/numRowsOnAPage);
         if(pageIndex>=totalNumPages)
    return NO_SUCH_PAGE;
         g2.translate(pageFormat.getImageableX(),
    pageFormat.getImageableY());
         g2.drawString("Page: "+(pageIndex+1),(int)pageWidth/2-35, //For printing the page no. at the bottom
    (int)(pageHeight+fontHeight-fontDesent));//bottom center
         g2.translate(0f,headerHeightOnPage);
         g2.translate(0f,-pageIndex*pageHeightForTable);
         //If this piece of the table is smaller than the size available,
         //clip to the appropriate bounds.
         if (pageIndex + 1 == totalNumPages)
    int lastRowPrinted = numRowsOnAPage * pageIndex;
    int numRowsLeft = tableView.getRowCount() - lastRowPrinted;
    g2.setClip(0, (int)(pageHeightForTable * pageIndex),
    (int) Math.ceil(tableWidthOnPage),
    (int) Math.ceil(oneRowHeight * numRowsLeft));
         //else clip to the entire area available.
         else{
    g2.setClip(0, (int)(pageHeightForTable*pageIndex),
    (int) Math.ceil(tableWidthOnPage),
    (int) Math.ceil(pageHeightForTable));
         g2.scale(scale,scale);
         tableView.paint(g2);
         g2.scale(1/scale,1/scale);
         g2.translate(0f,pageIndex*pageHeightForTable);
         g2.translate(0f, -headerHeightOnPage);
         g2.setClip(0, 0,(int) Math.ceil(tableWidthOnPage),
    (int)Math.ceil(headerHeightOnPage));
         g2.scale(scale,scale);
         tableView.getTableHeader().paint(g2);//paint header at top
         return Printable.PAGE_EXISTS;
    public static void main(String[] args)
         JFrame frame=new JFrame();
         RepaintManager.currentManager(frame).setDoubleBufferingEnabled(false);
         JPanel panel=new PrintReportPanels();
         frame.getContentPane().add(panel);
         frame.setSize(800,600);
         frame.setVisible(true);
    Pls. do provide the reply and tell me where i go wrong.I will be waiting for ur reply.It is very Urgent.
    Thanx,
    m.ananthu

    Hi conner,
    1) My font size problem is over i have used the tablename.setFont(new Font("Arial",Font.PLAIN,20)).It does change the font size of the JTable contents but the JTable Header still remains the same.I want to change the font size of the JTable header as well.How to do it?
    2)According to my second problem can u provide the code of how to change the page range from 1 - 9999 to 1-1?So that i will be very thankful to u.
    Thanx,
    m.ananthu

  • Problem with NIReport.llb\Print HTML Report using IE.vi on different machines

    We have 5 machines here in our workgroup which have the same state regarding security patches and other system updates. We recently found out that there is a problem with the NIReport.llb\Print HTML Report using IE.vi on the different machines.
    If I would open the VI on MachineA the control could be loaded. If I would open the VI on MachineB the control could be loaded. If I would copy the VI from MachineB to MachineA and open the VI the control could not be loaded. If I would copy the VI from MachineA to MachineB and open the VI on MachineB the control could be loaded. MachineB could load the version from MachineA and MachineB but on MachineA only the own version will load. I have seen that both versions have the same GUID for the Microsoft Webbrowser but are different in some other aereas.
    Since printing HTML Reports is part of the application which will be distributed as application I want to know if someone else have seen such a behaviour or has got problems distributing an application.
    Also I want to know which additional information is stored in an Active-X container about the control beside the GUID.
    We have Win XP Prof SP2 with MS IE 6.0.2900.2180 on all machines in the workgroup.
    Waldemar
    Using 7.1.1, 8.5.1, 8.6.1, 2009 on XP and RT
    Don't forget to give Kudos to good answers and/or questions

    Hi Tom,
    this is the VI <vi.lib>\Utillitiy\NIReport.llb\Print HTML Report using IE.vi copied from a machine that can load and run the VI and it will print. On this machine the control in the VI is white.
    This VI will give the "Control could not be loaded" message on my machine.
    The file shdocvw.dll is 2006-10-23 16:18 size 1.460 KB and I verifyed that both machines have the same version of this file.
    Waldemar
    Using 7.1.1, 8.5.1, 8.6.1, 2009 on XP and RT
    Don't forget to give Kudos to good answers and/or questions
    Attachments:
    Print HTML Report using IE.png ‏11 KB

  • How to print html file on client system without viewing data on client syst

    I want to print html data from database.
    i am not able to print it using java code,
    javascript can do that.
    but in javascript window is opened on client browser.
    but i dont want to open that
    var disp_setting="toolbar=no,location=no,directories=no,menubar=no,";
           disp_setting+="scrollbars=no,width=0,height=0";
         var docprint = window.open("","",disp_setting);
         //docprint = new PopUpWindow() ;
         docprint.document.write('<%= mm %>');
         docprint.document.close();
            docprint.focus();
         docprint.document = null; mm contents the data to be printed. it prints well but window is shown
    in mm there is <BODY self.print() > so it prints on printer but i am viewing window i donot want to view window....
    and print Dialog box also.. I want to by pass this both.
    please send me code or any help regarding that.
    ....

    1. Post a javascript question on a javascript forum please.
    2. Don't think you can bypass without some plugin/setting on the client browser.

  • Print html file without seeing a print dialog box

    i need to script an action that would allow a user to print a sparcly formated html file to a printer while bypassing the normal print dialog box.
    the unix lpr command seems like it might work, but the man page only mentions PS and txt files.
    Ultimately i'd want to trigger the print action from a php script, but it could be a folder action also.
    Does anyone have any suggestions or point me in the right direction.

    lp is the right command to use but you may need to convert the html file in PDF format before printing it. Just test it. Also type man lp to see more options.
    enscript is a nice utility that may help you. man enscript for more.
    Mihalis.

  • Print HTML FILE

    Hi all :
    I save a HTML FILE ,, I want to print this file from labview ,, how can I do that
    thanks

    Hi Mike :
    Sorry that I am asking so lot ,, but I don,t know how to Change "Print HTML Report.vi" in the same way and save it with a new name. i am using labview 8.5 I don,t see "print HTML Report.vi", I have "print report.vi "only
    Who  can I change it  ?? can you explain or send 
    thank alot 

Maybe you are looking for

  • How to compile all forms in a directoy at time?

    Hi friends, thank for your replies for the previous questions. Now How to compile all form modules located in a directory at a time? usually what I know is opening form one by one and compile it. But I want to compile all forms and create executable

  • 500 Internal Server Error while executing WAD

    Hi Everyone, I am executing a WAD and following the steps as mentioned. Opening a variant dialog box (this will show the values of the variables at that point in time) -> Changing any of the variable values - Clicking OK -> Clicking Cancel button in

  • I am looking to buy a laptop for my daughter who is in college.

    I am looking to buy my daughter a mac pro laptop and I wanted to know what software is comes with the computer.

  • How do you stop/disable createEmptyMovieClip function

    I am designing a graph to allow line drawing. After the user draws the line, they will drag words (movieclips) from a menu onto to the graph. I am not able to turn of the line drawing function, so when the words are dragged another line is created. I

  • What is the Purpose of this Forum?

    If it is to reduce traffic by driving people away, forcing them to log on simply to read to see if there is an answer to their question, or to see if there is a question they might be able to answer, then you guys are on the right track! If the origi