Skip to Content
0
Former Member
Mar 20, 2009 at 08:04 AM

How we can print out and footer for ALV Grid

27 Views

Hello,

When i use below this code not getting print preview and print out header and footer

please give sosend me one exaple report.

When i use below this code header is display only in standard output list but did not get print out.

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 = 140.

  • text = 'THE TATA IRON & STEEL CO. LTD.'.

*

  • CALL METHOD document->add_text

  • EXPORTING

  • text = text

  • sap_style = 'S'.

  • CALL METHOD document->add_gap

  • EXPORTING

  • width = 160.

  • text = 'TOWN SEVICES'.

*

  • CALL METHOD document->add_text

  • EXPORTING

  • text = text

  • sap_style = 'S'.

*

*

*CALL METHOD document->add_gap

  • EXPORTING

  • width = 132.

  • text = 'DATE WISE STATUS REPORT FOR'.

*

  • CALL METHOD document->add_text

  • EXPORTING

  • text = text

  • sap_style = 'S'.

*

*text = 'Date : '.

  • CALL METHOD document->add_text

  • EXPORTING

  • text = text

  • sap_emphasis = 'Strong'.

*

  • CALL METHOD document->add_gap

  • EXPORTING

  • width = 6.

*

  • text = sy-datum.

  • CALL METHOD document->add_text

  • EXPORTING

  • text = text

  • sap_style = 'Key'.

*

  • CALL METHOD document->add_gap

  • EXPORTING

  • width = 50.

*

  • CALL METHOD document->new_line.

  • CALL METHOD document->new_line.

  • CALL METHOD document->new_line.

*

  • text = 'User Name : '.

  • CALL METHOD document->add_text

  • EXPORTING

  • text = text

  • sap_emphasis = 'Strong'.

*

  • CALL METHOD document->add_gap

  • EXPORTING

  • width = 6.

*

  • text = sy-uname.

  • CALL METHOD document->add_text

  • EXPORTING

  • text = text

  • sap_style = 'Key'.

*

  • CALL METHOD document->add_gap

  • EXPORTING

  • width = 50.

*

*

  • text = 'Date : '.

  • CALL METHOD document->add_text

  • EXPORTING

  • text = text

  • sap_emphasis = 'Strong'.

*

  • CALL METHOD document->add_gap

  • EXPORTING

  • width = 6.

*

  • text = sy-datum.

  • CALL METHOD document->add_text

  • EXPORTING

  • text = text

  • sap_style = 'Key'.

*

  • CALL METHOD document->add_gap

  • EXPORTING

  • width = 50.

*

  • text = 'Time : '.

  • CALL METHOD document->add_text

  • EXPORTING

  • text = text

  • sap_emphasis = 'Strong'.

*

  • CALL METHOD document->add_gap

  • EXPORTING

  • width = 6.

*

  • text = sy-uzeit.

  • CALL METHOD document->add_text

  • EXPORTING

  • text = text

  • sap_style = 'Key'.

*

  • CALL METHOD document->new_line.

  • CALL METHOD document->new_line.

*

*

*ENDFORM. "HTML_TOP_OF_PAGE

and same thing for footer,

display footer only stadard output list but i have not get printout

code are below

FORM end_of_list_html USING end TYPE REF TO cl_dd_document.

DATA: ls_text TYPE sdydo_text_element,

l_grid TYPE REF TO cl_gui_alv_grid,

f(14) TYPE c VALUE 'SET_ROW_HEIGHT'.

ls_text = 'Footer title'.

  • adds and icon (red triangle)

CALL METHOD end->add_icon

EXPORTING

sap_icon = 'ICON_MESSAGE_ERROR_SMALL'.

  • adds test (via variable)

CALL METHOD end->add_text

EXPORTING

text = ls_text

sap_emphasis = 'strong'.

  • adds new line (start new line)

CALL METHOD end->new_line.

  • display text(bold)

CALL METHOD end->add_text

EXPORTING

text = 'Bold text'

sap_emphasis = 'strong'.

  • adds new line (start new line)

CALL METHOD end->new_line.

  • display text(normal)

CALL METHOD end->add_text

EXPORTING

text = 'Normal text'.

  • adds new line (start new line)

CALL METHOD end->new_line.

  • display text(bold)

CALL METHOD end->add_text

EXPORTING

text = 'Yellow triangle'

sap_emphasis = 'strong'.

  • adds and icon (yellow triangle)

CALL METHOD end->add_icon

EXPORTING

sap_icon = 'ICON_LED_YELLOW'.

  • display text(normal)

CALL METHOD end->add_text

EXPORTING

text = 'More text'.

*set height of this section

CALL FUNCTION 'GET_GLOBALS_FROM_SLVC_FULLSCR'

IMPORTING

e_grid = l_grid.

CALL METHOD l_grid->parent->parent->(f)

EXPORTING

id = 3

height = 14.

ENDFORM. "end_of_list_html.

Thaks & Regards

Zeba