How to print smartform on the basis of selection criteria

i want to print multiple pages in smartform by using  select-options  bkpf-belnr.
ex:1500002103 to 1500002106.
print all the pages lie in between this range.
Moderator message : Spec dumping is not allowed, search for available information. Thread locked.
Edited by: Vinod Kumar on Sep 27, 2011 12:21 PM

Hi,
  Refer the link select option in smartforms and read what i suggested..
Regards,
Dhina..

Similar Messages

  • How to print envelopes on the HP OfificeJet Pro 8600,

    Hi there folks; 
    Recently I ran into several folks asking on how to print envelopes in the same printer The HP Officejet 8600
    Do to this I decided to provide both the instructions in this document as well as the links of the article where I refer to for the information. This way folks that want to have it quick and to the point can accomplish this by reading and following this article and any folk that want to dig deeper perhaps the article will provide more in depth information
    This is how to load the envelopes;
    I will provide the link of the Article where this information have been gathered from;
    http://h10025.www1.hp.com/ewfrf/wc/document?docname=c02890475&cc=us&dlc=en&lc=en&product=4323648&tmp...
    Here the steps for loading the envelopes on the Officejet pro 8600.
    Grasp the handle on the front of the input tray, and then pull the tray towards you to open it.
    Figure 12: Pull out the input tray
    Slide the paper width guides out as far as possible.
    NOTE:If you are loading larger-sized paper, pull out the tray extension to lengthen the tray.
    Figure 13: Input tray extension
    Insert the envelopes into the center of the tray with the envelope flap on the left and facing up. If the flap is on the short end of the envelope, insert the envelope into the center of the tray with the flap toward the product and facing up.
    Figure 14: Load envelopes
    Slide the paper width guides in to rest against the edges of the envelope. Make sure that the envelope is centered in the tray.
    Push the tray into the product until it clicks into place.
    Figure 15: Push in the input tray
    Pull out the tray extender on the output tray.
    Figure 16: Pull out the tray extender
    This is the explanation on how to load envelopes into the 8600. Hope is helpful
    Now let’s make sure that the envelopes use are supported by the printer,
    This article will also provide you with envelopes support by this printers;
    http://h10025.www1.hp.com/ewfrf/wc/document?docname=c02858465&cc=us&dlc=en&lc=en&product=4323648&tmp...
    Is an important to properly load the envelopes as to use only envelopes supported by the printer.
    you might spend countless hours trying to figure what is the problem without realizing that the issue is  the  envelope you are actually using is not supported.
    Here is a list of the envelopes supported by the Officejet 8600
    Paper type
    Paper size
    U.S. 10 envelope
    105 x 241 mm (4.1 x 9.5 inches)
    A2 envelope
    111 x 146 mm (4.4 x 5.8 inches)
    DL envelope
    110 x 220 mm (4.3 x 8.7 inches)
    C5 envelope
    162 x 229 mm ( 6.4 x 9.0 inches)
    C6 envelope
    114 x 162 mm (4.5 x 6.4 inches)
    Monarch envelope
    98 x 191 mm (3.9 x 7.5 inches)
    Card envelope
    111 x 152 mm (4.4 x 6.0 inches)
    Chou #3 envelope
    120 x 235 mm (4.7 x 9.3 inches)
    Chou #4 envelope
    90 x 205 mm (3.5 x 8.1 inches)
    Hope this is helpful.  
    I welcome any comments and questions;
    RobertoR 

    You can say THANKS by clicking the KUDOS STAR. If my suggestion resolves your issue Mark as a "SOLUTION" this way others can benefit Thanks in Advance!
    This question was solved.
    View Solution.

    On my OJ Pro 8600, When I go to print a # 10 envelope, it feeds the envelope through and then prints the address on a letter page.  I was forced to set the printer preferences to #10 envelope, and within Word, set the paper type to # 10 envelope, set Word up for center feed, and then put everything back to print normally.  ON my 6500 all I had to do was hit print.  There must be a way to print single envelopes without jumping through all these hoops!!

  • How to print/list all the groups/users present in Weblogic using Java code

    Hi,
    Weblogic version : 11.1.1.5
    How to print/list all the groups/users present in Weblogic using Java code
    I want to make a remote connection to Weblogic server and print all the users/groups present in it.
    I have gone through the below mentioned site, but I cannot use the same approach since most of the API' are deprecated for example "weblogic.management.MBeanHome;"
    http://weblogic-wonders.com/weblogic/2010/11/10/list-users-and-groups-in-weblogic-using-jmx/
    Thanks in advance,
    Edited by: 984107 on 05-Feb-2013 05:26
    Edited by: 984107 on 05-Feb-2013 22:59

    see this http://www.techpaste.com/2012/06/managing-user-groups-wlst-scripts-weblogic/
    Hope this helps.

  • How do I find out the base dir for the current workspace ? Change?

    Assume I took over a colleagues JDeveloper installation.
    How can I find out the base dir for his JDevelopers workspace?
    Can I change this workspace base dir afterwards/later (without
    problems for the included sources and projects) ?
    Where can I change it ?
    I did not found an option in the settings?

    If you hover your mouse over the workspace you'll see the directory where the jws file is stored.
    For each project in the workspace you can go to the project properties and look up information in the content node of the preference - there you can also change the location preferences for where code is created.

  • How can I test for the bas unit enterd in a control?

    How can I to create a polymorphic vi where the user can enter either volume or temperature.
    how can Labwiev test for the base unit entered
    pseudocode example:
    input X
    if X.base_unit == m^3 do ....... 
    thanks for any suggestion to resolve or avoid my problem
    Solved!
    Go to Solution.

    Hi schaerm,
    you have to dig deeper.
    An idea is this one:
    The red marked word is containing the unit - in a coded way. Somewhere in the LV help you can find the description of this coding (I remember a chapter on memory representations of all LV datatypes...). (There surely is an easier or better way - but the example is done quic&dirty.)
    You can also format the number into a string and analyze the unit here...
    Message Edited by GerdW on 02-07-2010 07:21 PM
    Best regards,
    GerdW
    CLAD, using 2009SP1 + LV2011SP1 + LV2014SP1 on WinXP+Win7+cRIO
    Kudos are welcome

  • How to print x to the power of y in a script.

    hi,
    How to print x to the power of y in a script.
    thanks,
    amit

    Hi
    It is possible in scripts as well.
    First create a character format(assume c1); in that for Superscript click the ON then in you text you can just
    PF X <c1> Y < /> (hey, here i'm unable write the slash... i hope you know how to close it in any script).
    It is x to the power of y.
    Regards
    Surya.

  • The parameter name [...] in the query's selection criteria does not match..

    Hi all,
    I'm trying to pratice EJB 3 (which I learnt at school), with JSF and JPA, but i'm really stuck with that error :
    Exception [TOPLINK-6094] (Oracle TopLink Essentials - 2.0 (Build b41-beta2 (03/30/2007))): oracle.toplink.essentials.exceptions.QueryException
    Exception Description: The parameter name [departmentID] in the query's selection criteria does not match any parameter name defined in the query.
    Query: ReadAllQuery(oracle.datamodel.Employees)
    I will try to explain clearly what i'm trying to do :
    In fact, i'm following that tutorial :
    http://www.oracle.com/technology/obe/obe1013jdev/10131/ejb_and_jpa/master-detail_pagewith_ejb.htm
    But, as i didn't have any oracle database, but had a mysql one on my machine, i decided to use that DB instead of the the oracle DB... So i created a set of example data (to replace the oracle example set) ...so i created the tables EMPLOYEE, and DEPARTMENT... with the correct relations (FK) and PK)
    All was ok, i choose my "mysql-connector" (jdbc) instead of the oracle jdbc connector... so i could follow the tutorial.
    My problem appears at the step 12 (of "Creating a Master-Detail JavaServer Faces Page"), when i run the file deptEmployees.jspx.
    The information of the first departement displays correctly :
    departmentID 1
    departmentName ... etc
    but it can't display the employees belonging to that department !
    the error is :
    JBO-29000: Exception Description: The parameter name [departmentID] in the query's selection criteria does not match any parameter name defined in the query. Query: ReadAllQuery(oracle.datamodel.Employees)
    I think i understand what is the problem... I think that the query in charge of gathering the data of a specific departement need a parameter, but couldn't find it. But i don't know why :-/ I have tried many things and read the topics talking about that error... but it didn't solved the problem. I don't know anymore where to investigate.
    I have created a Zip file of my work (it's an EJB/JSF Application.. with jdev 10.1.3.3.0)
    (available here : http://dl.free.fr/mQ5esdQuS/EJB_appli.zip)
    I would be glad if someone could take few minutes to help me.
    Thank you in advance,
    Thomas B (student)

    Hello,
    This is a common mistake. Java string comparisons in TopLink are case sensitive by default, and since column names are uppercase when defaulted, TopLink cannot find the "departmentID" column name. In this case, Departments ID column defaults to "DEPARTMENTID" as required by the JPA specification.
    Either change Departments id annotation to     @Id
        @Column(name="departmentID", nullable = false)
        private Integer departmentID;or change Employees' ManytoOne annotation to:
        @ManyToOne
        @JoinColumn(name = "departmentID", referencedColumnName = "DEPARTMENTID")
        private Departments departments;Best Regards,
    Chris

  • How to print items in the MAIN window of the NEXT page (smartform)?

    Dear forumers,
    There are two pages (FIRST and NEXT) in my smartform with the same MAIN windows in each of the pages. Whatever that are changed in FIRST-MAIN window will also be seen in NEXT-MAIN window.
    I will need to control the printing of table TABLE3 contents (already contained in the MAIN window) such that if a variable V_MAT_PRINT is 'X', the TABLE3 contents will only be printed in NEXT page and not printed in FIRST page at all.
    How may I achieve this? Please help.
    Thank you.

    >
    Mohammed Ahasanullah Mulla wrote:
    > Hi Deborah,
    >
    > I had also faced a similar situation,in my case it was three pages..However i will try to tell you for 2 pages..After the second table .Add a program lines and force a page break only if V_MAT_PRINT is 'X'. After the program lines add a command and make the go to new page as second page.This will solve your problem.I have done the same and its working fine .If you have any questions do ask.
    >
    > Thanks,
    > Ahsan
    Hi Ahsan,
    Here's my case.
    If V_MAT_PRINT is 'X', print the following:-
    FIRST page, MAIN window
    - TABLE1
    - TABLE2
    - TABLE4
    - TABLE5
    NEXT page, MAIN window
    - TABLE3
    If V_MAT_PRINT is not 'X', print the following (no additional controls / changes are needed, everything remains unchanged):-
    MAIN window
    - TABLE1
    - TABLE2
    - TABLE3
    - TABLE4
    - TABLE5
    In this case, is a page break suitable? I doubt it as TABLE4 and TABLE5 will still need to be printed back on the FIRST page regardless of the V_MAT_PRINT value.
    Please advise further. Thanks.

  • How to print smartforms

    Hi All,
    I have to print my smart form.I have a printer  installed on my computer  but how should let SAP know about it?

    Hi,
    The Basis person has to configure the printer as an OUTPUT Device (default) for printing anything.
      The smart form which you developed is a Stand Alone one? I mean You are executing it from SE38 or from a std Transaction. Like for example for PO  it can be executed from ME22/23 or from ME9F? If it s Std Smartform output then you have to attach the SMARTFORM  to the related OUTPUT TYPE and DRIVER PROGRAM. Use the Transaction NACE to go there depending on your application of the Smart form for which you developed.
    Regards,
    Chaitanya

  • How to print Smartform in Draft mode.

    HI all,
    we are using Wipro LQ DSI 5232 printer, our problem is while printing smartform , its coming in Roman but it should come in Draft Mode.
    When it goes to Roman mode the printing become very slow.
    How to set in default Draft mode.
    Regards,
    Rahul.

    Hi,
    there is an SBO setting inside
    Administation>System Init>Print preferences>Print Draft Watermark on Draft
    Then a "DRAFT" watermark will appear if it's printed before adding.
    In CR use a stored proc to get data back according to the Objectid@.
    Then if its the object id of a draft then add a CR watermark.
    Hope this helps.
    Regards,
    D

  • How to print smartform from a report

    Im displaying a report, which contains several documents, whereby which ewch document is connected to a smartform.
    The page displaying the report contains a button 'Print'
    When clicking on the Print button, all the documents in the report should be printed.
    But my program is creating a spool file of the report, which will be printed further - its not what I want
    I want the program to print the smartforms of each documents on the report directly.
    heres my code and I dont know what I should do to be able to print the smartforms directly
    Get the function module name of the smartform.
        CALL FUNCTION 'SSF_FUNCTION_MODULE_NAME'
          EXPORTING
            formname = '/EU000/FI_PRINT_DEBIT_NOTE'
          IMPORTING
            fm_name  = g_fm_name.
    gw_options-tdnoprev = ' '.
    gw_options-tddest = 'LOCL'.
    gw_options-tdprinter = 'LOCL'.
    gw_options-tdnewid = 'X'.
    gw_options-tdimmed = 'X'.
    gw_control-preview = ' '.
    gw_control-no_dialog = 'X'.
    write: text-006,' ', text-007, ' ', text-008.
    write:/.
    For all the documents
        LOOP AT gi_all_data INTO gw_all_data.
          write: gw_all_data-gjahr(4), ' ',gw_all_data-belnr,'     ', gw_all_data-belnr.
          write:/.
    CASE SY-UCOMM.
    WHEN 'PRINT'.
    Call the smarform
          CALL FUNCTION g_fm_name
            EXPORTING
              gw_all_data = gw_all_data
              user_settings = ' '
              output_options = gw_options
              control_parameters = gw_control.
    WHEN 'BACK'.
    LEAVE SCREEN.
    ENDCASE.

    DATA:   x_control_parameters TYPE ssfctrlop,
            x_output_options TYPE ssfcompop.
    SELECTION-SCREEN BEGIN OF BLOCK b1 WITH FRAME TITLE text-001.
    PARAMETERS: p_prin LIKE usr01-spld.
    SELECTION-SCREEN BEGIN OF LINE.
    INITIALIZATION.
      SELECT  spld
              FROM usr01
              INTO p_prin UP TO 1 ROWS
              WHERE bname = sy-uname.
      ENDSELECT.
    START-OF-SELECTION.
      x_output_options-tdimmed = c_x.
      x_output_options-tddest = p_prin.
      x_output_options-tdnewid = c_x.
      x_output_options-tdreceiver = sy-uname.
      x_output_options-tdcopies = '001'.
      x_control_parameters-device = 'PRINTER'.
      x_control_parameters-no_dialog = c_x.
      x_control_parameters-langu = sy-langu.
      CALL FUNCTION 'SSF_FUNCTION_MODULE_NAME'
       EXPORTING
         formname                 = 'Z_SMARTFORM'
      VARIANT                  = ' '
      DIRECT_CALL              = ' '
      IMPORTING
        fm_name                  = f_name1
      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.
    IF P_PRI = 'X'.
      CALL FUNCTION F_NAME1
        EXPORTING
      ARCHIVE_INDEX              =
      ARCHIVE_INDEX_TAB          =
      ARCHIVE_PARAMETERS         =
       CONTROL_PARAMETERS          = X_CONTROL_PARAMETERS
      MAIL_APPL_OBJ              =
      MAIL_RECIPIENT             =
      MAIL_SENDER                =
       OUTPUT_OPTIONS              = X_OUTPUT_OPTIONS
      USER_SETTINGS              = 'X'
          wa_header                  = wa_zmexh51
    IMPORTING
      DOCUMENT_OUTPUT_INFO       =
      JOB_OUTPUT_INFO            =
      JOB_OUTPUT_OPTIONS         =
        TABLES
          tab_item                   = TAB_ZMEXD51
          tab_item1                  = TAB_ZMEXS51
    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.
      ENDIF.
    ELSEIF P_PRE = 'X'.
      CALL FUNCTION F_NAME1
        EXPORTING
      ARCHIVE_INDEX              =
      ARCHIVE_INDEX_TAB          =
      ARCHIVE_PARAMETERS         =
      CONTROL_PARAMETERS          = X_CONTROL_PARAMETERS
      MAIL_APPL_OBJ              =
      MAIL_RECIPIENT             =
      MAIL_SENDER                =
      OUTPUT_OPTIONS              = X_OUTPUT_OPTIONS
      USER_SETTINGS              = 'X'
          wa_header                  = wa_zmexh51
    IMPORTING
      DOCUMENT_OUTPUT_INFO       =
      JOB_OUTPUT_INFO            =
      JOB_OUTPUT_OPTIONS         =
        TABLES
          tab_item                   = TAB_ZMEXD51
          tab_item1                  = TAB_ZMEXS51
    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.
      ENDIF.
    ENDIF.
    Check the above code its just similar requirement  it may helpful to you.
    Thanks,
    Phani.

  • How to Print Text in the PLD when we select Type : Text

    Hi All
    I designed a PLD for Purchase Order which is working well but
    whenever we select type: Text and we enter some text in the row level for each item. when we see the PLD priview
    Items are displaying but the text below the items are not displaying
    it displays an empty row after each item
    How should i print text in the PLD
    I required in this following Format
    ITEMCODE  DESCRIPTION      QTY
    001              XYZ                      20
    this is capital Good Item
    002             PQR                        30 
    this is Raw Material
    In this above format
    I didnt get the text below the Items
    Can any one suggest the correct answer

    Thanks for your reply
    I already select the linetext field from table POR10 and kept it  in the PLD
    but i didnt get my required format
    after giving that line text field  iam getting
    in this way
    S.No.        ITEMCODE   DESCRIPTION  QTY
       1               001               XYZ                 20
    this is Capital Goods
      2                                                                 
    this is Capital Goods
    the text is repeating twice
    I Put the ItemDescription field  in POR1 and Line Text Field in POR10 in the same repetitve area

  • How to Print File as the same as picture/fax viewer ?

    Hallo :
    I wrote a program which can let the specified png file to be printed. (png file is about 17xx * 11xx, output to A4 paper)
    The goal is the print result as the same as the windows built-in picture/fax viewer (by Full Page Fax Print Mode)
    And I don't want the printer dialog to be appeared. So I tried to use java print service to achieve this goal.
    Now I can print the file by printer.
    But comparing to the result which is printed by the windows built-in picture fax viewer(use Full Page Fax Print Mode), my result looks like zoom in, not full page.
    I tried some classes of javax.print.attribute.standard package, but no one worked.
    So I tried to transform the image by myself. And I found a resource : [http://java.sun.com/products/java-media/2D/reference/faqs/index.html#Q_How_do_I_scale_an_image_to_fit]
    It looks like what I wanted. But when I implemented the functionality according to that reference. The result is still the same, still zoom in...
    I must said I am unfamiliar with java 2D. But this is a problem I must solve.
    If the problem can be solved by only setting some classes of javax.print.attribute.standard, it's better.
    But if can't be solved by that way, the transformation method is ok, too.
    So does anyone can help me to solve this problem or pointed where I was wrong ? Thank you very much.
    import java.io.*;
    import java.net.*;
    import java.text.DecimalFormat;
    import java.awt.*;
    import java.awt.geom.*;
    import java.awt.image.ImageObserver;
    import java.awt.print.*;
    import javax.print.*;
    import javax.print.attribute.*;
    import javax.print.attribute.standard.*;
    public class TestImage{
       private void testPrint2() {
         Image img = Toolkit.getDefaultToolkit().getImage(A); // A is png file path
         PrintRequestAttributeSet requestAttributeSet = new HashPrintRequestAttributeSet();
         requestAttributeSet.add(new Copies(1));
         requestAttributeSet.add(MediaSizeName.ISO_A4);
         requestAttributeSet.add(OrientationRequested.PORTRAIT);
         requestAttributeSet.add(MediaTray.MANUAL);
         PrintService[] services = PrintServiceLookup.lookupPrintServices(null, requestAttributeSet);
         if(services.length > 0){
              DocPrintJob job = services[0].createPrintJob();
              try {
                   job.print(new SimpleDoc(new TestPrint(img), DocFlavor.SERVICE_FORMATTED.PRINTABLE , null), requestAttributeSet);
              } catch (PrintException pe) {
                 pe.getStackTrace();
       class TestPrint implements Printable {
         private Image image;
         public TestPrint(Image image) {
              this.image = image;
         public int print(Graphics graphics, PageFormat pageFormat, int pageIndex) throws PrinterException {
              if(pageIndex > 0) {
                  return Printable.NO_SUCH_PAGE;
              Graphics2D g2d = (Graphics2D) graphics;
              //Set us to the upper left corner
              g2d.translate(pageFormat.getImageableX(), pageFormat.getImageableY());
              AffineTransform at = new AffineTransform();
              g2d.translate(0, 0);               
              //We need to scale the image properly so that it fits on one page.
              double xScale = pageFormat.getImageableWidth() / image.getWidth(null);
              double yScale = pageFormat.getImageableHeight() / image.getHeight(null);
              // Maintain the aspect ratio by taking the min of those 2 factors and using it to scale both dimensions.
              double aspectScale = Math.min(xScale, yScale);
              //g2d.drawRenderedImage(image, at);
              g2d.drawImage(image, at, (ImageObserver) this);
              return Printable.PAGE_EXISTS;               
       public static void main(String[] args) {
         new TestImage().testPrint2();
    }Edited by: oppstp on Aug 3, 2010 10:14 AM
    Edited by: oppstp on Aug 3, 2010 10:18 AM

    Thanks for the reply.
    Now my algorithm which I used is when the height of image is smaller than the height of A4 paper and the width of image
    is larger than the width of A4 paper, I will rotate 90 degree of the image first, then I will scale the image.
    Then I can get the approaching result when the width and height of the image are larger than the width and height of A4 paper.
    But there was an additional error. That is when the width of image is larger than the width of A4 paper and
    the height of image is smaller than the height of A4 paper. (like 17xx * 2xx).
    Although the print result template is approaching the picture/fax viewer. But the print quality is so bad.
    The texts are discontinue. I can see the white blank within the text. (the white line are the zone which printer doesn't print)
    First I thought this problem might be DPI issue. But I don't know how to keep the DPI when rotating ?
    (I dumped the rotate image, it rotates, but didn't keep the DPI value)
    Does anyone know how to solve this strange problem ? Thanks a lot.
    Below is my test code (the initial value of transX & transY and 875 are my experiment result)
    import java.io.*;
    import java.awt.*;
    import java.awt.geom.*;
    import java.awt.image.*;
    import java.awt.print.*;
    import javax.imageio.*;
    import javax.print.*;
    import javax.print.attribute.*;
    import javax.print.attribute.standard.*;
    public class TestCol{ 
       private void testPrint2() throws Exception {
          BufferedImage bSrc = ImageIO.read(new File(A)); // A is png file path
          PrintRequestAttributeSet requestAttributeSet = new HashPrintRequestAttributeSet();
          requestAttributeSet.add(new Copies(1));
          requestAttributeSet.add(MediaSizeName.ISO_A4);
          requestAttributeSet.add(OrientationRequested.PORTRAIT);
          PrintService[] services = PrintServiceLookup.lookupPrintServices(null, requestAttributeSet);
          if (services.length > 0) {
             DocPrintJob job = services[0].createPrintJob();
             try {
                job.print(new SimpleDoc(new TestPrint(bSrc), DocFlavor.SERVICE_FORMATTED.PRINTABLE , null), requestAttributeSet);
             } catch (PrintException pe) {
                pe.getStackTrace();
       class TestPrint implements Printable {
          private BufferedImage image;
          public TestPrint(BufferedImage image) {
             this.image = image;
          public int print(Graphics graphics, PageFormat pageFormat, int pageIndex) throws PrinterException {
             if(pageIndex > 0) {
                return Printable.NO_SUCH_PAGE;
             int transX = 10;
             int transY = 35;
             int imgWidth = image.getWidth();
             int imgHeight = image.getHeight();
             Graphics2D g2d = (Graphics2D) graphics;
             //Set us to the upper left corner
             AffineTransform at = new AffineTransform();
             double xScale = 0.0;
             double yScale = 0.0;
             if((double)imgWidth > pageFormat.getImageableWidth()) {
                if(imgHeight > 785) {         
                   // X:image larger, Y:image larger -> scale all > 1, no rotate
                   xScale = pageFormat.getImageableWidth() / imgWidth;
                   yScale = (double)785 / imgHeight;
                } else {       
                   // X:image larger, Y:image smaller -> rotate right 90 degree than scale X
                   // rotate right 90 degree
                   at.translate(imgHeight/2.0, imgWidth/2.0);
                   at.rotate(Math.toRadians(90.0));
                   at.translate(-0.5*imgWidth, -0.5*imgHeight);
                   //at.preConcatenate(g2d.getTransform()); // if add this line, the result is zoom out many times, and the result is  not one page
                   try {
                      // output rotating image for debug
                      BufferedImage bDest = new BufferedImage(imgHeight, imgWidth, BufferedImage.TYPE_INT_RGB);
                      Graphics2D g = bDest.createGraphics();
                      g.drawRenderedImage(image, at);
                      ImageIO.write(bDest, "PNG", new File(B)); // B is output png file path
                   } catch (Exception ex) {
                       ex.printStackTrace();
                   transX = (int)((pageFormat.getImageableWidth() - imgHeight)/2);         
                   xScale = 1.0;
                   yScale = (double)785 / imgWidth;
             } else {
                if(imgHeight > 785) {       
                   // X:image smaller, Y:image larger -> no rotate, scale Y
                   xScale = 1.0;
                   yScale = (double)785 / imgHeight;
                } else {         
                   // X:image smaller , Y:image smaller -> no scale, no rotate
                   xScale = 1.0;
                   yScale = 1.0;
            g2d.translate(transX, transY);
            g2d.scale(xScale, yScale);
            g2d.drawRenderedImage(image, at);
            return Printable.PAGE_EXISTS;     
       public static void main(String[] args) {
          try {
             new TestCol().testPrint2();
          } catch (Exception ex) {
             ex.printStackTrace();
    }Edited by: oppstp on Aug 4, 2010 10:46 AM

  • How to store smartform in the table TOA03 so that it can be archived later.

    Hi Friends,
    i have a very urgent requirement i.e to store the complete smartform in the link table TOA03 so that it can be archived later i.e it can be printed later. At present what i am doing is i am passing the parameters ARC_PARAMS and ARCHIVE_INDEX to the smartform function module, but i could not understand why it is not getting stored. Please suggest immediatly.

    Hi Satyesh,
    have a look at this thread... will it solve your problem?
    Smartform saving
    Regards,
    Naveen

  • How to print based on the logic that it is the last page of the report

    HI
    I want to print something on the last page.For example,I have to print a image(signature) file on the last page.How can I have the logic that it is the last page or any counter or variable to find that it is the last page of the report??
    Thanks in advance.

    Is there an example of this posted somewhere that actually works?
    I have used this exact syntax in everyway, every location possible and it either locks my MSWORD window on preview or throws a Java error.
    I am using the most current BIP template builder v10.1.3.2.1
    Thanks,
    Scott
    Sample files below:
    <?start:body?><?for-each:G_TEST?>
    <?TEST1?> <?TEST2?>
    <?TEST3?>
    THIS SHOULD PRINT ON ALL PAGES
    <?start@last-page:body?> PRINT ONLY ON THE LAST PAGE<?end body?>
    <?end for-each?><?end body?>
    <?xml version="1.0" encoding="WINDOWS-1252"?>
    <TEST>
    <LIST_G_TEST>
    <G_TEST>
    <TEST1>TEST Data Line Number One</TEST1>
    <TEST2>Test Data Line 2</TEST2>
    <TEST3>33 Test Data Line 3</TEST3>
    </G_TEST>
    <G_TEST>
    <TEST1>TEST Data Line Number One</TEST1>
    <TEST2>Test Data Line 2</TEST2>
    <TEST3>33 Test Data Line 3</TEST3>
    </G_TEST>
    <G_TEST>
    <TEST1>TEST Data Line Number One</TEST1>
    <TEST2>Test Data Line 2</TEST2>
    <TEST3>33 Test Data Line 3</TEST3>
    </G_TEST>
    <G_TEST>
    <TEST1>TEST Data Line Number One</TEST1>
    <TEST2>Test Data Line 2</TEST2>
    <TEST3>33 Test Data Line 3</TEST3>
    </G_TEST>
    <G_TEST>
    <TEST1>TEST Data Line Number One</TEST1>
    <TEST2>Test Data Line 2</TEST2>
    <TEST3>33 Test Data Line 3</TEST3>
    </G_TEST>
    </LIST_G_TEST>
    </TEST>

Maybe you are looking for

  • AH! My ipod is not being recognized by itunes!

    i have a ipod nano 2nd generation and have itunes7 on my computer... the itunes software doesn't recognize that my ipod is plugged into my computer but it's charging...? I'm so lost and I jsut want my ipod to work so I can add and take songs off from

  • How data  is replicated from SAP R/3 to SAP BW

    Hi,     I have to replicate datasource from SAP R/3 ECC 6.0 TO  SAP BW.   Please, help me in this regards Thks in advance - Mubeen.

  • Formatting  a Date

    Hi, Can someone tell me how to simply format the date to this: MON DD, YYYY Thanks

  • Can't drag items from desktop to Captivate 6.1 64bit

    I updated from Captivate 6.0.1 to 6.1 (both 64 bit) and can no longer drag items from the desktop or Adobe Bridge to a Captivate project.  I reinstalled 6.0.1 and could.  Again updated to 6.1 and again could not.  The Import to library button and the

  • Can I share ibooks between mac accounts

    My spouse has books on her ibook app I would like to read...how can she share them with me on my ibooks account?