Print Preview dialog

i am subin.k.s and i want to know how to make a reusable print preview component to which i can put the values from database and also print from there. how can i zoom the view

search the forum or google for Swing print preview, this topic has been covered extensively before.

Similar Messages

  • Smartform to PDF, how to suppres Print/Preview dialog

    Hi Experts,
    Facing some issues in downloading PDF converted from Smartform.
    In the program I am trying directly download a smartform converted into PDF format and save it in local system.
    When ever I am trying to execute the program it shows up the Print/Preview dialog before showing the Save As dialog.
    I have passed control_parameters-getotf = 'X' to the smartform runtime FM, which ideally should have suppressed the Print/Preview dialog and return the otfdata.
    Here the entire code is...
    REPORT  yfr_invoice.
    TABLES :  t001, bsad, bsid, kna1,sscrfields .
    DATA : fm_name TYPE rs38l_fnam.
    DATA : it_bsad TYPE STANDARD TABLE OF bsad.
    DATA : BEGIN OF it_bseg OCCURS 0,
            belnr TYPE belnr_d,
           END OF it_bseg.
    DATA : error_flag.
    DATA: 
           cont_param TYPE ssfctrlop,
           out_param  TYPE ssfcompop,
           otfdata    TYPE ssfcrescl,
           t_tline    TYPE TABLE OF tline INITIAL SIZE 0,
           t_docs     TYPE STANDARD TABLE OF docs,
           v_filesize TYPE i,
           v_name     TYPE string,
           v_path     TYPE string,
           v_fullpath TYPE string,
           v_filename TYPE string,
           v_filter   TYPE string.
    SELECTION-SCREEN BEGIN OF BLOCK b1 WITH FRAME TITLE text-000.
    SELECT-OPTIONS : s_bukrs FOR t001-bukrs NO-EXTENSION NO INTERVALS OBLIGATORY.
    SELECT-OPTIONS : s_gjahr FOR bsid-gjahr NO-EXTENSION NO INTERVALS OBLIGATORY.
    SELECT-OPTIONS : s_rebzg FOR bsid-rebzg OBLIGATORY.
    SELECT-OPTIONS : s_kunnr FOR kna1-kunnr.
    SELECTION-SCREEN END OF BLOCK b1.
    INITIALIZATION.
    START-OF-SELECTION.
      CALL FUNCTION 'SSF_FUNCTION_MODULE_NAME'
        EXPORTING
          formname           = 'YFF_INVOICE'
        IMPORTING
          fm_name            = fm_name
        EXCEPTIONS
          no_form            = 1
          no_function_module = 2
          OTHERS             = 3.
      IF sy-subrc <> 0.
        MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
                WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
      ENDIF.
    cont_param-getotf = 'X'.
    cont_param-no_dialog = 'X'.
    cont_param-preview = 'X' .
      CALL FUNCTION fm_name
        EXPORTING
          control_parameters = cont_param  "Passing getotf = 'X'
        IMPORTING
          job_output_info    = otfdata
        TABLES
          s_bukrs            = s_bukrs[]
          s_gjahr            = s_gjahr[]
          s_rebzg            = s_rebzg[]
          s_kunnr            = s_kunnr[]
        EXCEPTIONS
          formatting_error   = 1
          internal_error     = 2
          send_error         = 3
          user_canceled      = 4
          OTHERS             = 5.
        IF sy-subrc <> 0.
        MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
                WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
        ELSE.
          CALL FUNCTION 'CONVERT_OTF_2_PDF'
            IMPORTING
              bin_filesize           = v_filesize
            TABLES
              otf                    = otfdata-otfdata
              doctab_archive         = t_docs
              lines                  = t_tline
            EXCEPTIONS
              err_conv_not_possible  = 1
              err_otf_mc_noendmarker = 2
              OTHERS                 = 3.
          IF sy-subrc <> 0.
            MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
                    WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
          ENDIF.
          CONCATENATE 'filename' '.pdf' INTO v_name.
          CALL METHOD cl_gui_frontend_services=>file_save_dialog
            EXPORTING
              default_extension = 'PDF'
              default_file_name = v_name
              file_filter       = v_filter
            CHANGING
              filename          = v_name
              path              = v_path
              fullpath          = v_fullpath.
          CALL FUNCTION 'GUI_DOWNLOAD'
            EXPORTING
              bin_filesize            = v_filesize
              filename                = v_fullpath "'C:\Test.pdf'
              filetype                = 'BIN'
            TABLES
              data_tab                = t_tline
            EXCEPTIONS
              file_write_error        = 1
              no_batch                = 2
              gui_refuse_filetransfer = 3
              invalid_type            = 4
              no_authority            = 5
              unknown_error           = 6
              header_not_allowed      = 7
              separator_not_allowed   = 8
              filesize_not_allowed    = 9
              header_too_long         = 10
              dp_error_create         = 11
              dp_error_send           = 12
              dp_error_write          = 13
              unknown_dp_error        = 14
              access_denied           = 15
              dp_out_of_memory        = 16
              disk_full               = 17
              dp_timeout              = 18
              file_not_found          = 19
              dataprovider_exception  = 20
              control_flush_error     = 21
              OTHERS                  = 22.
          IF sy-subrc <> 0.
            MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
                   WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
          ENDIF.
        ENDIF.
      ENDIF.
    The program other wise works absolutly fine .
    Please advise.
    Thanks
    Jahan

    Moderator message - Cross post locked
    Rob

  • Download smartform as PDF, suppress Print/Preview dialog

    Hi Experts,
    Facing some issues in downloading PDF converted from Smartform.
    In the program I am trying directly download a smartform converted into PDF format and save it in local system.
    When ever I am trying to execute the program it shows up the Print/Preview dialog before showing the Save As dialog.
    I have passed control_parameters-getotf = 'X' to the smartform runtime FM, which ideally should have suppressed the Print/Preview dialog and return the otfdata.
    Here the entire code is...
    Moderator message - Please respect the 2,500 character maximum when posting. Post only the relevant portions of code
    The program other wise works absolutly fine .
    Please advise.
    Thanks
    Jahan
    Edited by: Rob Burbank on Apr 8, 2010 11:10 AM

    Helloo Guyz...
    I am exactly trying the same, but the Print Dialog is still coming ...
    See here is my code ..
    cont_param-getotf = 'X'.
    cont_param-no_dialog = 'X'.
    cont_param-preview = 'X' .
      CALL FUNCTION fm_name
        EXPORTING
          control_parameters = cont_param
        IMPORTING
          job_output_info  = otfdata
        TABLES
          s_bukrs             = s_bukrs[]
          s_gjahr              = s_gjahr[]
          s_rebzg             = s_rebzg[]
          s_kunnr             = s_kunnr[]
        EXCEPTIONS
          formatting_error  = 1
          internal_error      = 2
          send_error          = 3
          user_canceled    = 4
          OTHERS              = 5.
    even after this ..during execution the the Print Dialog is coming..
    I have no idea what esle I am missing..
    Thanks

  • Image looks great in PS- when I go to print it looks grainy in printer preview dialog box and prints blurry. Why?

    Image looks great in PS- when I go to print, it looks grainy in printer preview dialog box and prints blurry.  Why is this happening? 

    PS CC, Yosemite, Epson 3880 (called espson to make sure it wasn't something with that), saved as a tiff/psdjpg- all files behave the same way.  When I open the raw file- and only crop the image- it behaves this way now- with grain and blur when printing.  No other files do this in the same shoot.  I worked on this image- could something have gotten corrupted along the way such that now even opening the raw file creates this problem.  SInce upgrading my computer -  a window pops up when I open PS that says I need to update my graphics card?? for 3D- I'm not using 3D- so I don't know if that means anything.  I have to leave for about an hour- but greatly appreciate any feedback. I will be in touch. Thank you.

  • Problem with print preview dialog action in CS4

    I have a automation plugin for Photoshop that print a image playing a Photoshop print preview dialog.
    The script works on CS3 but not in CS4. There is some specific platform tags (Mac uses 'keyPrintSettings' and 'keyPageFormat' that are OpaqueStructPtr and it's not possible to take the size, and Windows uses 'keySystemInfo' and there is no information about this data) and it's not possible to ignore.
    I attach a sample functions for CS3 (working) and CS4 (not working).
    Some one have information about this problem?

    Hi, try to implement the note 1116359.
    reward if usefull.

  • Photoshop elements 2 print preview dialog box

    I'm running PSE 2 on a PC with Windows XP and an old Dell monitor with 800x600 resolution.  Problem: when I check the "More Options box, the box cuts off  at "Print Space"  And I can't control communication between PSE and the printer.  I've fooled with the windows control panel etc. to try to reduce the size of the dialog box to no avail.  PSE preferences does 't help either.   Am I doomed?

    Are you sure you can't change the resolution to 1024 x 768 pixels?
    Juergen

  • Print Templates print preview window closes unexpectly when printing document

    This is a cross posting from Internet Explorer Web Development after a suggestion that this forum would be a better location. See
    https://social.msdn.microsoft.com/Forums/ie/en-US/351e1245-b606-4467-9f3c-1c72f9cdf9ea/print-templates-print-preview-window-closes-unexpectly-when-printing-document?forum=iewebdevelopment.
    I have raised an issue through Connect for this:
    https://connect.microsoft.com/IE/feedback/details/1134168/ie9-to-ie11-print-templates-print-preview-window-closes-unexpectly-when-printing-document, but I would like some more visibility of the issue as my customers thought my application was closing when
    they printed a document.  I also don't know if an issue in Connect gets any priority support via MSDN, but this forum does.
    This looks to me like a problem in the IE Print Templates startDoc API call, but if there is a more appropriate forum to raise this issue in please let me know.
    In the application where I use print templates, the window closing is not in it self a problem because the Javascript that is calling startDoc also closes the Print Preview window when the print is finished.
    The fact that the application looses focus and can be hidden by the windows of other applications when the Print Preview window is closed by startDoc is the issue noticed by our customers, so I need a fix preferably, or a work around at a pinch.
    Details of the issue reproduced below.
    When using IE Print Templates, the startDoc function is causing the print preview window to close.  This behaviour started with IE9, and is still present with IE11.
    When an application is using print templates (see
    https://msdn.microsoft.com/en-us/library/aa753279(v=vs.85).aspx) for print functionality, this has the effect of causing the application to become hidden by any other application window once printing from the print preview window has started.  It is
    actually this behaviour that started me looking at this issue as the users thought the hosting application had closed.
    Print Templates are not accessible by using IE as a web browser, but only when using the WebBrowser Control to embed IE in an application.  The reference for this feature is available from this url:https://msdn.microsoft.com/en-us/library/aa753279(v=vs.85).aspx
    and a sample Microsoft application that demonstrates the use of Print Templates can be used to demonstrate the problem (required for the reproduction steps).  The application is available via this article and searching for "download spiffy".
    Steps to reproduce the problem:
    To see the full effect of the issue, first ensure there is a window from another application (like Windows Explorer) that will cover the sample applications window if brought to the foreground (making the Windows Explorer window full screen works).
    Start the sample application (and ensure that the full screen Window Explorer is the next application to activate).
    Then in the drop down box in the top right corner of the UI select Template8.htm.
    Click the Print Preview button that is just below the drop down box (this will open a new Print Preview window).
    In the new window click the Print… button (this will open a Print dialog).
    Click the Print button at the bottom of the Print dialog.
    The Print dialog closes (expected) and then the Print Preview window also closes (not expected), however the document is still printed successfully.
    When the Print Preview windows is closed unexpectedly, the Windows Explorer window is brought to the foreground (obscuring the sample applications window).
    If you reselect the sample application and click the Print Preview button again, the Print Preview dialog is not displayed unless you restart the application (this looks to be a symptom of the same issue, not a separate problem).
    To see that the Print Preview window appears to be closed by the startDoc call, use the resource editor in Visual Studio (the exe can be opened directly by File | Open | File…) to edit the HTML resource "TEMPLATE8.HTM" (I found I needed to delete
    it and add it back in for the change to stick), find the startDoc call and add two alerts, one on the line before and one on the line after.  When IE is accessing the template, it is being done using the name of the executable (so do not rename the modified
    version of printtemplates.exe, make the changes to a copy in a different directory if you don't want to change the original).  Start the modified version of the application and follow the same steps as in the reproduction.  This time, after clicking
    the Print button in the Print dialog, the dialog will close, the first alert will pop up, then the Print Preview window will close, then
    the second alert will pop up.
    Thank you,
    Warren.

    Hi Shu,
    I have noticed that the print templates API is listed as part of the Legacy APIs. 
    Is this just because it hasn't changed or is not new?  Or does this mean that it is no longer maintained and may be removed (or at least deprecated) at some point in the future? 
    It would good to know if we should start planning for the implementation of a different method of printing.
    I understand that the sample application is no longer maintained, but I also think that the Print Template API that it uses has not changed, and so should still work (and it does mostly).
    If the Print Preview window was being closed as a result of using the Print dialog (and if it had behaved the same way with IE8) I would be willing to go with the by design argument.  
    I have found that the Print Preview window is not closed until startDoc is called, and it closes before control is returned from the startDoc function. 
    Just as part of investigating and try to find a workaround, if I call window.close(), any alert calls made no longer display the alert window after the close call. 
    Alert still functions after startDoc has closed the window however. 
    The is not the sort of consistent behaviour I would expect from something that is by design. 
    Also while investigating, I found that calling startDoc after calling window.close() results in an exception with the error code -2147467259 (0x80004005), this is probably quite normal and expected, but does indicate that the Web Browser Control should
    not be closed till after printing.
    I had found that old thread, and I had concluded it was the same issue, but it was also aimed at different aspect of the problem (which I see in the sample application, but not my application). 
    The visible issue I have is that my users think the application has been closed because after clicking print (on the Print dialog) the application gets hidden by other windows from other applications. 
    This aspect affects the sample in the same manner and so it was a convenient way to demonstrate the problem.
    If IE connect do not look at this issue any time soon, do I have any other avenues to resolve this issue?
    Thank you,
    Warren.

  • Adobe Form Print Problem - Header is cut off without print preview

    We are currently experiencing a problem when trying to print Adobe forms.  We have created several forms and are experiencing the same issue with all forms.  The issue occurs when we are trying to print a form.  If we choose a print preview prior to printing, the form looks normal and prints fine.  However, if we do a direct print (i.e. no print preview), then the top part of the form is cut off.  It's almost like all of that data on the form gets shifted upward, cutting off about 1/2" to an 1" from the top of the form.  We have tried printing to different printers and are ending up with the same results each time.  We do not experience this issue with SAPScript.
    I have searched several threads and haven't been able to find an issue quite like the one we are experiencing.
    Has anyone ever exeperienced a problem like this before? 
    Currently using Adobe LiveCycle Designer 8.1.2 and are on Netweaver 7.00 EhP1.
    Thank you for any help.

    I am going to go ahead and close this thread as I believe we have found a solution.  Sai is correct that there is an issue with the design.
    If anyone else runs into this problem, take a look at note 968394 that talks about differences between print preview and printing from spool.  When you are in the print preview dialog box, under "Page Scaling," the default is "Shrink to printable area."  So if your form went outside the margins, it would shrink to fit giving you the impression that the problem is not with the print preview rather than the form itself. 
    After moving the header stuff down a bit everything is printing normal both through the spool and via print preview.
    Thank you!

  • Print preview need to hide for Adobe form

    hi frineds
      I have created a function module which converts the adobe form in pdf using the function module FP_FORMOUPUT, When ever i execute the function module it ask for print preview. I dont want print preview. Since i need to use this custom function module in my worklfow. If its a smartform i can hide the print preview nodialogue = 'X'. But there is no such option in Adobe form. How can i achieve this. Am using ABAP not webdynpro.
    Regards
    vijay

    Answer there is a function module FP_JOB_OPEN which is used to hide print preview, dialog and so on. This function module only i was looking on. I got by myself.

  • Java Printing - Print Preview

    Hey, could anybody point me in the direction on how to create a print preview dialog box. I can already print the document that I created. Thanks for the help.

    public static void printPreview(BufferedImage buffer, Pageable job, PageFormat pageFormat, int page) {
       Graphics2D  g = (Graphics2D) buffer.getGraphics();
       //figure out the size of your page and the size of your buffer, and scale appropriately using Graphics2D.scale
       Pageable.getPrintable(g, pageFormat, page);
    }

  • Create a Print Preview

    Hi, how can i create a print preview for a Text Component and/or a JTable (or any other component)?
    I know that i must write the print method but i need some intresting examples of all the classes that i have to develop.
    Thanks

    If you only want to print content that can be
    displayed by a JEditorPane then you may want to check
    out my DocumentPrinter, which you can get from
    http://www.dcs.shef.ac.uk/~mark/software/swing/
    As well as printing Documents that can be loaded by a
    JEditorPane it also allows you to specify headers and
    footers and provides a print preview dialog box.
    At the moment it works but it could do with some
    improvements including memory usage which I'm
    currently working on. Any feedback if you do use it
    or feature requests would be appreciated,
    MarkHi Mark,
    I must commend you for developing such a wondeful java printing solution (Document Printer). I have a question, is it posible for me to be able to call a new page from my code. I have generated some pay slips from my application with HTML and i want only 2 pay slips per page. Is it possible for me to call a new page from my code using document printer....please i need it badly...
    Thanks
    Jaji Lukman

  • Print Preview is missing from Firefox 6 on Mac OSX Lion in both File Menu and Print Dialog Box

    The question says it all really. Print Preview option is missing from both the File menu and from the Print dialog box when you select Print. I use Print Preview a lot to avoid wasting paper.
    A relevant issue might be that the Mac OSX app Preview is currently having trouble with various printers including my Xerox and so, temporarily, the default application for all Preview items is now Adobe Reader until Apple get their act together. Perhaps this is affecting things?
    Thanks for any help

    It's moved to the PDF dropdown, "Open PDF in Preview"

  • Returning to Print dialog from Print preview?

    If, after selecting Print preview from the Print dialog, I want to go back and change something in the Print dialog like Layout, is it possible to return to the Print dialog? What I've been doing is quitting the Preview and then going back to what I wanted to print and selecting Print again, which seems inefficient.

    Hi Christopher,
    Unfortunately it's not possible. This is one of the limitations of the preview function of OSX printing. Perhaps this will be addressed in Leopard. It's pretty frustrating, I totally agree.

  • Print dialog is not showing the correct Print Preview document, image, or artboard sizes; printer is printing incorrectly

    This is what the Print Dialog looks like. The print preview is too small. The final printed images are coming out all wrong.
    This is happening for ALL DRIVERS (5 different printers) and 2 different USERS in our company.
    It doesn't matter if you change the Media Size or any of the other settings here in the "Print" dialog, the "Page Setup..." dialog, the printer's own "Setup..." settings, etc... it's like Illustrator is using the wrong Artboard size. And why is there so much dark gray area around the page in the Print Preview? It looks really messed up.
    We need this fixed immediately. This is a crazy bad bug... we can't print!
    Illustrator: 8.1.1
    Computer: MacBook Pro Retina Mid 2012 OS X version 10.10.1

    It's a bug in Illustrator.  See this post:
    Illustrator print preview is not displaying the preview properly. Any clue as to why?

  • Upgraded to 29.0.1 on XP. Print preview shows but when I hit print it just "dings" and nothing else, no print. No dialog box apprears either.

    Printing from all other programs works fine including Chrome and Explorer. Ever since my Foxfire browser was updated to 29.0.1 I have not been able to print webpages.
    When I hit print the computer does an audible "ding" and nothing happens. Doesn't matter if I choose File>print, f10, <ctrl> P or "print" from print preview, same thing happens.
    The printer is on-line and recognizable by other apps.
    No dialog box appears so I cannot choose a printer.
    When I hit page setup I only get "format & options" and "margins & header/footer".
    Help!

    Hi,
    Thank you for your question. There are two things I would try. It is possible that the printer settings may need to be reset. [[Fix printing problems in Firefox]] or you Java may need to be updated. Check if they are up to date with [http://www.mozilla.org/en-US/plugincheck/ Plug in check]
    [[Troubleshoot issues with plugins like Flash or Java to fix common Firefox problems]]

Maybe you are looking for

  • Weird PDF problem in iPhone OS

    I went to read a PDF posted on web page and some of the graphics didn't show up, but others did. The same thing happened on my iPhone using iPhone OS 3.1.3. They show up fine on my iMac using Mac OS X. At first I thought it might be Flash related but

  • Metadata template

    I created a couple metadata templates that are no longer active and I would like to delete them. Unfortunately, I can't find a way to do this and I have done a lot of research. Can someone tell me how to delete them?

  • 1005000 &1005029 Essbase Error - MaxL Export database

    Hi, I'm trying to export data in a MaxL command called by a Perl program (automated batch process) using the following command: export database StgAll.StgAll level0 data in columns to data_file 'H:/Export_folder_server09/StgALL_export_server.txtThe P

  • When I choose external editor in iPhoto on my iMac it does not recognize Aperture. When I do the same on my laptop it works? Any ideas?

    When I choose external editor in iPhoto on my iMac it does not recognize Aperture. When I do the same on my laptop it works? Any ideas?

  • Cannot integrate Lightroom and Photoshop

    Windows Vista 32bit, Photoshop CS3, Lightroom 1.1 When I try to export from lightroom Photoshop will not open. I have to open manually using "open as administrator". Once open lightroom still cannot send a file to Photoshop it applies Lightroom chang