Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

Print ALV Header and ALV footer

Former Member
0 Kudos

Hello all,

Thanks everyone whoever helped me with the idea of displaying Header and footer in ALV grid using CL_DD_DOCUMENT

FORM HTML_TOP_OF_PAGE USING DOCUMENT TYPE REF TO CL_DD_DOCUMENT.

   DATA: TEXT TYPE SDYDO_TEXT_ELEMENT.

  CALL METHOD DOCUMENT->ADD_GAP
    EXPORTING
      WIDTH = 100.
      TEXT =  'ALV HEADER'.

  CALL METHOD DOCUMENT->ADD_TEXT
    EXPORTING
      TEXT      = TEXT
      SAP_STYLE = 'HEADING'.

ENDFORM.                    "HTML_TOP_OF_PAGE

I now have both Header and footer for the ALV perfectly.

But I am not able to print them. When i check Print Preview then it shows the normal report without header/footer.

Why is that? How to acheive it?

Thanks.

5 REPLIES 5

MarcinPciak
Active Contributor
0 Kudos

Check this one

Regards

Marcin

0 Kudos

Thanks Marcin.

But i am looking to print the Header and footer as shown in my ScreenShot here and not the one that we write using WRITE statements.

http://img833.imageshack.us/img833/2443/printalvheader.jpg

I am using ALV Grid with HTML TOP OF PAGE & HTML END OF LIST

CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
 EXPORTING
*   I_INTERFACE_CHECK                 = ' '
*   I_BYPASSING_BUFFER                = ' '
*   I_BUFFER_ACTIVE                   = ' '
   I_CALLBACK_PROGRAM                = SY-REPID
*   I_CALLBACK_PF_STATUS_SET          = ' '
*   I_CALLBACK_USER_COMMAND           = ' '
*   I_CALLBACK_TOP_OF_PAGE            = ' '
   I_CALLBACK_HTML_TOP_OF_PAGE       = 'WRITE_HEADING_ALIGNED'
   I_CALLBACK_HTML_END_OF_LIST       = 'WRITE_FOOTER_ALIGNED'
   IS_LAYOUT                         = LAYOUT
   IT_FIELDCAT                       = I_FIELDCAT
   IT_EVENTS                         = LT_EVENTS
   IS_PRINT                          = GD_PRNTPARAMS
  TABLES
    T_OUTTAB                          = ITAB
          .
ENDFORM.                    "ALV_GRID_DISPLAY

Can someone please tell me how to print them ?

Thanks.

0 Kudos

Hi friend,

Simplify check sample report BCALV_TEST_FULLSCREEN_HTML

Regards,

0 Kudos

Hi Thien Pham Minh ,

I already got that output on screen. But while printing using a printer, then i cant get that Html header and footer.

My question was how to print them on paper. If we can display on screen then we should be able to print them too. Isnt?

Thanks.

0 Kudos

I'm afraid that we can not. Please try another way.

Good luck