Skip to Content
author's profile photo Former Member
Former Member

alv grid field truncated for print preview

hi,

I have developed an alv report using grid display.

there are two fields in the output of length 20 each.

They get displayed correctly in grid format.

But, when on the output screen, I click on List menu and goto "Print Preview",

the output gets displayed in a list format where these two fields get displayed in a truncated format.

I have tried all options such as optimize colwidth and giving outputlen for the fieldcatalog.

But, still the problem persists, only for printing and print preview.

Please suggest a solution.

Thanks & Regards,

Tejas Savla

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

4 Answers

  • Posted on Mar 27, 2008 at 03:56 PM

    try to provide different parameters for printing

    in function REUSE_ALV_GRID_DISPLAY and in method SET_TABLE_FOR_FIRST_DISPLAY of class CL_GUI_ALV_GRID it is parameter IS_PRINT

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Mar 28, 2008 at 03:44 AM

    If you are using FM REUSE_ALV_GRID_DISPLAY.

    CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'

    EXPORTING

    I_CALLBACK_PROGRAM = repid

    I_CALLBACK_TOP_OF_PAGE = 'TOP_OF_PAGE'

    IS_LAYOUT = gt_layout

    IT_FIELDCAT = gt_fieldcat

    IT_SORT = lt_sort

    I_DEFAULT = 'X'

    I_SAVE = 'X'

    IT_EVENTS = it_events[]

    IS_PRINT = printalv

    TABLES

    T_OUTABab = it_output

    Declare printalv

    DATA: printalv TYPE slis_print_alv

    Thanks,

    siddu

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Mar 28, 2008 at 03:50 AM

    Hi ronak,

    Please follow the below Code . if you have all events implemented in your Code and compare for the Print event .

    DATA: gt_events type slis_t_event,
    gd_prntparams type slis_print_alv.
    
    call function 'REUSE_ALV_GRID_DISPLAY'
    exporting
    i_callback_program = gd_repid
    i_callback_top_of_page = 'TOP-OF-PAGE'
    is_layout = gd_layout
    it_fieldcat = fieldcatalog[]
    it_events = gt_events 
    is_print = gd_prntparams 
    i_save = 'X'
    tables
    t_outtab = it_ekko
    exceptions
    program_error = 1
    others = 2.
    
    perform build_events.
    perform build_print_params.
    
    &------------------------------------------------------------------
    *& Form BUILD_EVENTS
    &------------------------------------------------------------------
    
    Build events table 
    -------------------------------------------------------------------
    form build_events.
    data: ls_event type slis_alv_event.
    
    call function 'REUSE_ALV_EVENTS_GET'
    exporting
    i_list_type = 0
    importing
    et_events = gt_events[].
    read table gt_events with key name = slis_ev_end_of_page
    into ls_event.
    if sy-subrc = 0.
    move 'END_OF_PAGE' to ls_event-form.
    append ls_event to gt_events.
    endif.
    
    read table gt_events with key name = slis_ev_end_of_list
    into ls_event.
    if sy-subrc = 0.
    move 'END_OF_LIST' to ls_event-form.
    append ls_event to gt_events.
    endif.
    endform. " BUILD_EVENTS
    
    &------------------------------------------------------------------
    *& Form BUILD_PRINT_PARAMS
    &------------------------------------------------------------------
    
    
    Setup print parameters 
    -------------------------------------------------------------------
    form build_print_params.
    gd_prntparams-reserve_lines = '3'. "Lines reserved for footer
    gd_prntparams-no_coverpage = 'X'.
    endform. " BUILD_PRINT_PARAMS
    
    &------------------------------------------------------------------
    *& Form END_OF_PAGE
    &------------------------------------------------------------------
    form END_OF_PAGE.
    data: listwidth type i,
    ld_pagepos(10) type c,
    ld_page(10) type c.
    
    write: sy-uline(50).
    skip.
    write:/40 'Page:', sy-pagno .
    endform.
    
    
    &------------------------------------------------------------------
    *& Form END_OF_LIST
    &------------------------------------------------------------------
    form END_OF_LIST.
    data: listwidth type i,
    ld_pagepos(10) type c,
    ld_page(10) type c.
    
    skip.
    write:/40 'Page:', sy-pagno .
    endform.

    Reward points if it is usefull ....

    ~Lakshmiraj~

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Apr 02, 2008 at 12:31 PM

    Hi All,

    Thanks for your replies.I have tried the various options given by some of you above,but still the problem persists.

    Can anyone please suggest the best fit solution.

    Thanks in advance.

    Regards,

    Tejas

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.