Conditinoal formatting - How to highlight even lines in a report ?

The report standards folks in my team came up with a new standard i.e. highlight all the even number lines in the report so that the report will be more readable. Is there an easy way to do it using format triggers or something ? The entire row or a group of rows needs to be highlighted. How to accomplish this ?

Hi Suresh,
If a line is equivalent to a row of data, you can put the format trigger in the repeating frame for that row. To count the rows, you can create a running count by having a summary column in that group which does the count and resets at report or some higher level. If :running_count mod 2 = 0 then you can execute the code in your format trigger, otherwise, just return true.
Hope that helps,
Toby

Similar Messages

  • How to highlight entire line

    I am currently implementing an IDE. I try to highlight entire line(not only text but also following blank field) when users set a breakpoint on that line.
    Using Highlighter.addhighlight(start, end, HighlightPainter) only allow me to highlight the text part in the line. I haven't figure out how to do that.
    Any helps are appreciated.

    one way to highlight a full line or draw a breakpoint
    symbol on a particular is to create a custom highlight
    painter and override the paint method. If you want to
    highlight the full line then use the width from the
    JTextArea and only the y coordinate and height from
    the view coordinates.
    If you would like a breakpoint symbol and a particular
    line then just put a drawImage call in the paint method
    which draws an icon on that line
    I've included some code for custom painter for both
    highlighting a full line and rendering a breakpoint
    icon.
         private class     SingleLineHighlighterPainter      extends DefaultHighlighter.DefaultHighlightPainter {
                   public     SingleLineHighlighterPainter( Color color )
                   {     super( color );          }
         * Paints a highlight over a single line.
                   * just uses the first point a work around only
         * @param g the graphics context
         * @param offs0 the starting model offset >= 0
         * @param offs1 the ending model offset >= offs1
         * @param bounds the bounding box for the highlight
         * @param c the editor
              public void paint(Graphics g, int offs0, int offs1, Shape bounds, JTextComponent c) {
                        Rectangle alloc = bounds.getBounds();
                             Rectangle area = c.getBounds();
                             try {
                        // --- determine locations ---
                                       TextUI mapper = c.getUI();
                                       Rectangle p0 = mapper.modelToView(c, offs0);
                        // --- render ---
                                       Color color = getColor();
                                       if (color == null) {
                                       g.setColor(c.getSelectionColor());
                                       else {
                                       g.setColor(color);
                        // render using just the y coordinates and height from the initial point
                                       g.fillRect(0, p0.y, alloc.width, p0.height);
                             catch (BadLocationException e) {
                        // can't render
         private class     BreakpointPainter      extends DefaultHighlighter.DefaultHighlightPainter {
                        public     BreakpointPainter()
                        {     super( Color.green );          }
              * Paints a breakpoint image
                        * just uses the first point a work around only
              * @param g the graphics context
              * @param offs0 the starting model offset >= 0
              * @param offs1 the ending model offset >= offs1
              * @param bounds the bounding box for the highlight
              * @param c the editor
                   public void paint(Graphics g, int offs0, int offs1, Shape bounds, JTextComponent c) {
                             Rectangle alloc = bounds.getBounds();
                                  Rectangle area = c.getBounds();
                                  try {
                             // --- determine locations ---
                                            TextUI mapper = c.getUI();
                                            Rectangle p0 = mapper.modelToView(c, offs0);
                                            Image im = ( (ImageIcon) Icons.stopSignIcon ).getImage();
                             // render using just the y coordinates and height from the initial point
                                            g.drawImage( im,0,p0.y+2,null );          
                                  catch (BadLocationException e) {
                             // can't render
    to use these do the following
         DefaultHighlighter dh = new DefaultHighlighter();
              dh.setDrawsLayeredHighlights( false );
              SingleLineHighlighterPainter     dhp = new SingleLineHighlighterPainter(Color.green);
              BreakpointPainter                    bpp = new BreakpointPainter();
              buff.setHighlighter(dh);
              try {
                   dh.addHighlight(25, 30, dhp);     // single line highlighter here
                   dh.addHighlight(60, 60, bpp);     // add breakpoint highlighter here
                   dh.addHighlight(120,120,bpp);     // add breakpoint highlighter here
              catch (javax.swing.text.BadLocationException jst) { };
              buff.setMargin( new Insets( 0,20,0,0 ) );
    where numbers used with the addHighlight method are
    the location within the model. In this case the
    addHighlight( 25,30, dhp ) will highlight the line with
    a view location corresponding to position 25 in
    the model. So just need to specify any model location
    on the line you want to highlight.
    Setting breakpoints is the same just need one model
    position on the line where you want the image to be
    drawn.
    Hope that's clear.
    Also helps to look at the source code for
    DefaultHighlighter.java.
    eric
    [email protected]

  • How to insert horizontal lines in alv report?

    hi,
        i have to insert horizontal lines in alv report.( RM07MLBB )
            actually my requirement is:
                               basis list = RM07MLBB.
    first secondary list = another report is called here ( RM07DOCS )
                      i want to insert horizontal lines in the first secondary list, when i execute individually RM07DOCS , i can get horizontal lines, but when i dounle click in the basic list --> in the first secondary list , i am not getting the horizontal lnes.
    functional modules used are REUSE_ALV_HIERSEQ_LIST_DISPLAY & REUSE_ALV_GRID_DISPLAY.
        here in this program,
                        is_layout = alv_layout.
    hence i tried to give     
                  alv_layout-no_hline = ' '. 
    but not effecting.
              can some one please tell me , how to insert lines in the alv report.
    thanks in advance,
    Dastagir.

    hello,
         so i cannot insert horizontal lines in the first secondary list according to my sorting condition, i.e., in a single block there should be :
           if same delivery challan number is repeating they should come in the same block,
    for the corresponding delivery challen number, if have po number, is repeating , they also should come in the same block.
                       in this way i have to seperate the blocks containing EXNUM , EBELN CONDITIONED.

  • How to create 2 lines header in Report painter

    Hi. I am not good at Report painter. I want to create 2 lines header in Report painter just like SAP std report.
    When I create a new form, I only have one line header form but cannot add additional header line.
    I am looking at the 0SAPFS10-01 Trans.Fig.- Balances. which has two header lines
                               Debit              Credit            Balance       Accumulated Balanc
    Periods                     &1FY               &1FY               &1FY               &1FY
    I can create only one header just like
    Periods                 Debit              Credit            Balance       Accumulated Balanc
    cannot add additional line for
          &1FY               &1FY               &1FY               &1FY
    please advise me
    thanks in advance.

    In report painter you can select variouselements based on which the data will be pulled. I haven't seen any report painter with two header lines and don't think report painter allows that. But for your requirement I believe you can select the periods in the header line itself.

  • How to highlight a line in a text stream and position the cursor at the end.

    I would like to select a line in a text control data stream, highlight the text, and place the cursor at the end of the line so that the text control can be edited at that point.

    Depends on what you mean by "highlight". If you mean highlight in the sense of when you use the mouse to select text, then you can't do that and then place the cursor at the end, since that would effectively "unhighlight" the text. You need to use a different kind of "highlight", like turning the text bold or something. This KB article talks about highlighting particular characters: How Do I Highlight Particular Characters in a String Control?
    See attached for simple example. Modify as needed.
    Attachments:
    Text Select.vi ‏19 KB

  • How to select multiple lines in ALV report

    hi gurus,
    I am working on an interactive ALV report where i have to select multiple lines from the basic list into an internal table, based on check box clicks. Using RS_SELFIELD i can select only 1 row. The coding has been done based on Call Function. Can u please suggest some way.
    Regards,
    Satyajit

    hi,
    try like this
    TABLES:     ekko.
    TYPE-POOLS: slis.                                 "ALV Declarations
    TYPES: BEGIN OF t_ekko,
      sel,                         "stores which row user has selected
      ebeln TYPE ekpo-ebeln,
      ebelp TYPE ekpo-ebelp,
      statu TYPE ekpo-statu,
      aedat TYPE ekpo-aedat,
      matnr TYPE ekpo-matnr,
      menge TYPE ekpo-menge,
      meins TYPE ekpo-meins,
      netpr TYPE ekpo-netpr,
      peinh TYPE ekpo-peinh,
    END OF t_ekko.
    DATA: it_ekko TYPE STANDARD TABLE OF t_ekko INITIAL SIZE 0,
          wa_ekko TYPE t_ekko.
    DATA: fieldcatalog TYPE slis_t_fieldcat_alv WITH HEADER LINE,
          fieldcatalog1 TYPE slis_t_fieldcat_alv WITH HEADER LINE,
          gd_tab_group TYPE slis_t_sp_group_alv,
          gd_layout    TYPE slis_layout_alv,
          gd_repid     LIKE sy-repid.
    DATA : BEGIN OF det_tab OCCURS 0,
            ebeln LIKE ekpo-ebeln,
           END OF det_tab.
    START-OF-SELECTION.
      PERFORM data_retrieval.
      PERFORM build_fieldcatalog.
      PERFORM build_layout.
      PERFORM display_alv_report.
    *&      Form  BUILD_FIELDCATALOG
    *       Build Fieldcatalog for ALV Report
    FORM build_fieldcatalog.
      fieldcatalog-fieldname   = 'EBELN'.
      fieldcatalog-seltext_m   = 'Purchase Order'.
      fieldcatalog-outputlen   = 10.
      fieldcatalog-emphasize   = 'X'.
      fieldcatalog-key         = 'X'.
      APPEND fieldcatalog TO fieldcatalog.
      CLEAR  fieldcatalog.
      fieldcatalog-fieldname   = 'EBELP'.
      fieldcatalog-seltext_m   = 'PO Item'.
      APPEND fieldcatalog TO fieldcatalog.
      CLEAR  fieldcatalog.
      fieldcatalog-fieldname   = 'STATU'.
      fieldcatalog-seltext_m   = 'Status'.
      APPEND fieldcatalog TO fieldcatalog.
      CLEAR  fieldcatalog.
      fieldcatalog-fieldname   = 'AEDAT'.
      fieldcatalog-seltext_m   = 'Item change date'.
      APPEND fieldcatalog TO fieldcatalog.
      CLEAR  fieldcatalog.
      fieldcatalog-fieldname   = 'MATNR'.
      fieldcatalog-seltext_m   = 'Material Number'.
      APPEND fieldcatalog TO fieldcatalog.
      CLEAR  fieldcatalog.
      fieldcatalog-fieldname   = 'MENGE'.
      fieldcatalog-seltext_m   = 'PO quantity'.
      APPEND fieldcatalog TO fieldcatalog.
      CLEAR  fieldcatalog.
      fieldcatalog-fieldname   = 'MEINS'.
      fieldcatalog-seltext_m   = 'Order Unit'.
      APPEND fieldcatalog TO fieldcatalog.
      CLEAR  fieldcatalog.
      fieldcatalog-fieldname   = 'NETPR'.
      fieldcatalog-seltext_m   = 'Net Price'.
      fieldcatalog-outputlen   = 15.
      fieldcatalog-do_sum      = 'X'.        "Display column total
      fieldcatalog-datatype     = 'CURR'.
      APPEND fieldcatalog TO fieldcatalog.
      CLEAR  fieldcatalog.
      fieldcatalog-fieldname   = 'PEINH'.
      fieldcatalog-seltext_m   = 'Price Unit'.
      APPEND fieldcatalog TO fieldcatalog.
      CLEAR  fieldcatalog.
    ENDFORM.                    " BUILD_FIELDCATALOG
    *&      Form  BUILD_LAYOUT
    *       Build layout for ALV grid report
    FORM build_layout.
      gd_layout-box_fieldname     = 'SEL'.
      "set field name to store row selection
      gd_layout-edit              = 'X'. "makes whole ALV table editable
      gd_layout-zebra             = 'X'.
    ENDFORM.                    " BUILD_LAYOUT
    *&      Form  DISPLAY_ALV_REPORT
    *       Display report using ALV grid
    FORM display_alv_report.
      gd_repid = sy-repid.
      CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
        EXPORTING
          i_callback_program       = gd_repid
          i_callback_user_command  = 'USER_COMMAND'
          i_callback_pf_status_set = 'SET_STAT'
          is_layout                = gd_layout
          it_fieldcat              = fieldcatalog[]
          i_save                   = 'X'
        TABLES
          t_outtab                 = it_ekko
        EXCEPTIONS
          program_error            = 1
          OTHERS                   = 2.
      IF sy-subrc <> 0.
    * MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
    *         WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
      ENDIF.
    ENDFORM.                    " DISPLAY_ALV_REPORT
    *&      Form  DATA_RETRIEVAL
    *       Retrieve data form EKPO table and populate itab it_ekko
    FORM data_retrieval.
      SELECT ebeln ebelp statu aedat matnr menge meins netpr peinh
       UP TO 10 ROWS
        FROM ekpo
        INTO CORRESPONDING FIELDS OF TABLE it_ekko.
    ENDFORM.                    " DATA_RETRIEVAL
    *       FORM USER_COMMAND                                          *
    *       --> R_UCOMM                                                *
    *       --> RS_SELFIELD                                            *
    FORM user_command USING r_ucomm LIKE sy-ucomm
                      rs_selfield TYPE slis_selfield.
    * Check function code
      CASE r_ucomm.
        WHEN '&IC1'.
          IF rs_selfield-fieldname = 'EBELN'.
            READ TABLE it_ekko INTO wa_ekko INDEX rs_selfield-tabindex.
            SET PARAMETER ID 'BES' FIELD wa_ekko-ebeln.
            CALL TRANSACTION 'ME23N' AND SKIP FIRST SCREEN.
          ENDIF.
        WHEN 'DET'.  "button add by me
          CLEAR det_tab.
          REFRESH det_tab.
          LOOP AT it_ekko INTO wa_ekko WHERE sel = 'X'.
            MOVE-CORRESPONDING wa_ekko TO det_tab.
            APPEND det_tab.
          ENDLOOP.
          PERFORM build_cat.
          PERFORM dis_data.
      ENDCASE.
    ENDFORM.                    "user_command
    *&      Form  set_stat
    *       text
    *      -->RT_EXTAB   text
    FORM set_stat USING rt_extab TYPE slis_t_extab.
      SET PF-STATUS 'ZSTAT' EXCLUDING rt_extab.
    ENDFORM.                    "set_stat
    *&      Form  build_cat
    *       text
    FORM build_cat.
      CLEAR fieldcatalog1.
      REFRESH fieldcatalog1.
      fieldcatalog1-fieldname = 'EBELN'.
      fieldcatalog1-tabname = 'DET_TAB'.
      fieldcatalog1-seltext_m = 'Order No.'.
      fieldcatalog1-outputlen = 10.
      APPEND fieldcatalog1 TO fieldcatalog1.
      CLEAR fieldcatalog1.
    ENDFORM.                    "build_cat
    *&      Form  dis_data
    *       text
    FORM dis_data.
      CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
        EXPORTING
          i_callback_program = 'ZTEST_DS'
          it_fieldcat        = fieldcatalog1[]
          i_save             = 'X'
        TABLES
          t_outtab           = det_tab.
    ENDFORM.                    "dis_data
    here i have copied standard gui status of ALV into my z status ZSTAT and add one button DET......
    here u can select morethan one line using control(ctrl)
    reward if usefull...

  • How to draw custom line in crystal report without manually entering value?

    Hi,
    I have a bubble chart and want to represent custom lines one in x-axis and one in y-axis at the value arrived based upon an internal calculation.There is an option to manually enter value for custom line.
    But i want to generate custom line at runtime without manually entering it.
    Can somebody help out?
    Regards,
    Felix

    Not sure what this has to do with Database Connectivity?
    Moved it to the Report Designer forum. If you are using code then specify what Report engine and version you are using and we can move it again.

  • How to print all lines in alv report?

    hi
    i am using the functions 'FP_JOB_OPEN'  and 'FP_JOB_CLOSE'  in order to print the form
    i want it to be printed without prompting me the 'PRINT' window and pushing the ok button .
    is there a way to do that ? i put reqimm = 'X' and nodialog = 'X' but it didnt fix it
    thanks

    Hi Ami,
       At START-OF-SELECTION event write your code between below statements.
    NEW-PAGE PRINT ON NO DIALOG.
    Your Code
    NEW-PAGE PRINT OFF.
    This statement NEW-PAGE PRINT ON with addition of NO DIALOG will not prompt you for Printer selection. It will directly create a spool.

  • How to select multiple lines in reports

    Hi,
    how to select multiple lines in a reports and process those selected lines to other activities like BDC.
    Please paste sample report here. or any demo examples . (don't paste ALV report , paste only classical report)
    suppose there are 10 records in output, i want to select 3 records and process other activities like bdc.
    Point will awarded.

    Hi ,
    the o/p in ur case will be a basic list output with a check box enabled in the left .
    Now say there are 10 records in the list output and i have checked 3 of them where checkboxes are enabled .
    And i press a button to submit this to the BDC .
    Here u need to make use of
    READ LINE statement to read the records from the list output and then pass them to the BDC .
    The code would be something like this
    DO .
    Read line index <field> where checkbox <> ' '.
    ENDO.
    You can have a look at the F1 help on read line . This will mkae u clear .
    Hope this gives u an idea.
    Regards,
    Vijay.

  • BDC - ME52N  how to replicate highlighting a line and coping it

    Hello All,
      i have used SHDB on transaction ME52N and have the code but what is not happening is, when i do the ME52N i highlight the first detail line and then depress the copy icon to create a second line. This is what i can not get to work in the BDC anyone have any ideas. It will not highlight the line and make a copy of it.
             thanks Scott

    Hi Scott,
    Why do you want to copy the line item. How is the 1st line item created. If the 1st line item is created by populating values from your own internal table, then even for creating 2nd line item, populate the data into 2nd from from the internal table itself.
    If you select a line item and click on copy, it validates the 1st line item, checks for mandatory input values viz. material no, quantity, unit, G/L account no.,account assignment category.
    Try to execute the transaction manually and populate the data. If it is working fine then try BDC for the same data with CALL TRANSACTION with MODE `A`.
    Best regards,
    Prashant

  • How to highlight the whole row of a particular line item of sale

    How to highlight the whole row of a particular line item of sales order depending on condition?
    Please help its urgent..
    Looking forward your reply.
    Moderator message: please do more research before asking, show what you have done yourself when asking, do not flag posts as "urgent".
    [Rules of engagement|http://wiki.sdn.sap.com/wiki/display/HOME/RulesofEngagement]
    [Asking Good Questions in the Forums to get Good Answers|/people/rob.burbank/blog/2010/05/12/asking-good-questions-in-the-forums-to-get-good-answers]
    Edited by: Thomas Zloch on Aug 9, 2011 9:30 AM

    Any ideas on what would cause this NOT to work? I added this row right after the table is created and populated and it is still not highlighted when I enter the form. The snippet of code that does this is:
    MyTableModel modelS = (MyTableModel)dataModel.get("S");
    jTable1 = new JTable(modelS);
    jTable1.setRowSelectionInterval(0,0);MyTableModel is this:
    class MyTableModel extends DefaultTableModel {
      public MyTableModel(Object[] columnNames, int numRows) {
        super(columnNames, numRows);
      public boolean isCellEditable(int row, int column) {
        if (TableKey == 'S') {
          if (column == 6) {
            return false;
        if (TableKey == 'O') {
          if (column == 0 || column == 4 || column == 5) {
            return false;
        if (TableKey == 'P') {
          return false;
      return true;
    }Can anyone help? Thanks.
    Allyson

  • Word Processing problem:  How do I highlight different lines to edit at....

    How do I highlight different lines/words at the same time to edit simultaneously.
    Ex
    I like school
    School is fun
    Let's go to school
    I can't wait
    If I wanted to highlight the first and third line to center at the same time, how exactly would I do that?

    Hi Jeremiah,
    Can't be done. AppleWorks doesn't support non-contiguous selection.
    For your particular example, you can center lines one and three by this procedure:
    Place the insertion point in line 1.
    Press command-\
    Place the insertion point in line 3.
    Press command-\
    Regards,
    Barry

  • How I activate, when in code view current code line, to be highlighted (all line) eg light-blue ?

    How I activate, when in code view current code line, to be
    highlighted (all line) eg light-blue ?

    Actually, in Windows (XP) the highlight color (in DW8) is a
    byproduct of the
    color scheme you set for your desktop.
    Walt
    "Michael" <[email protected]> wrote in message
    news:gn7fpk$hbp$[email protected]..
    > In code view, click the line number in the left margin
    corresponding to
    > the line of code you wish to highlight. Left click that
    number and the
    > whole line will be highlighted in blue.
    >
    > Michael
    >

  • How to highlight a certain line in textArea?

    Hi
    I want to know how can i highlight certain line in atextArea with diffeent colors
    Thanks in advance

    highlight certain line in atextArea with diffeent colorsAre you talking about the foreground or background color??
    If its the foreground, all the text must be the same color. If you need multiple colored text then you need to use a JTextPane.
    If its the background then you can use a Highlighter.
    textArea.getHighlighter().addHighlight(...);

  • How to highlight the repeated records in a BO crystal report?

    Hi ,
    How to highlight the repeated records in a BO crystal report?
    we want to highlight the rows for which account number is same.
    thanks
    sriram

    You don't even need to create a group.  Just sort the records on the fields that define "duplicate".  Then you can just use
    if {field} = PreviousValue({field}) then crYellow else crNoColor
    in the format's Background Color formula.  This will cause the background to be yellow on duplicates.  (If you need to check more than one field in order to determine duplicates, just insert
    and {field2} = PreviousValue({field2}
    and so on for each field that needs to be checked.
    HTH,
    Carl

Maybe you are looking for

  • What is the ip port number for a 1st generation airport express

    I have recently upgraded my home wireless router from a Linksys EA2700 to a EA6500.  The EA2700 worked fine with my 1st generation Airport Express.  Since I have mavericks on my laptop (Airport Utility 6.x is incompatible with Airport Express/b/g) I

  • Save EAN11 field while creating POrder creation through Function module

    Hi All, I want to update EAN11 field in material master while creating Purchase Order through function module. I am using function module BAPI_PO_CREATE1 for creating purchase order. There are no structures in the PO creation FM in which EAN11 field

  • Tablespace usage report generated with html tags instead of text

    Hi , We have a unix shell script scheduled to find tablespace usage and sends the report to our mail id. For the past few weeks(no changes idone in the script) the report is coming with html tags instead of text as below. </head> <body> <p> <table bo

  • Photo Captions in iWeb '08

    Hi I am new to iWeb, having just purchased a new iMac with iLife '08 installed. I had been using a shareware program called "Better HTML Export" with iPhoto '04 to quickly create photo albums for my website,which worked well, but I have been looking

  • Mac cannot find WPA-2 enterprise wifi when updated to Mavericks

    My MacBook air cannot find WPA-2 enterprise wifi on the network list when updated to Mavericks, but I can add the network by choosing "joining other network" and typing username and password manually. Anyone knows how to solve this problem?