cancel
Showing results for 
Search instead for 
Did you mean: 

Print ALV in pdf with header

Former Member
0 Kudos

Hi experts,

I've done an ALV in an iview using Component SALV_WD_TABLE. I have button 'Print view' in ALV, and when I push it I can download de ALV in PDF format. That's perfect.

Now, I want to print the ALV in PDF format with some Header information. This information is in Context, but not in the ALV.

I have donne a header in the ALV using cl_salv_wd_header and if_salv_wd_table_settings~create_header but that's not what I'm looking for. I want header in the PDF but not in the ALV view...

Any help?

Thanks and regards!

Urtzi.

Accepted Solutions (0)

Answers (2)

Answers (2)

Former Member
0 Kudos

Hi,

You can set header text for PDF print specifically by use of following method

DATA: lo_cmp_usage type ref to if_wd_component_usage.
  DATA: lr_salv_wd_table TYPE REF TO iwci_salv_wd_table.
 Data: lr_function_settings TYPE REF TO CL_SALV_WD_CONFIG_TABLE.
 DATA: lv_header_text type string.

*create an instance of ALV component
  lo_cmp_usage =   wd_this->wd_cpuse_OVERVIEW_RET_ALV( ).

* if not initialized, then initialize
  if lo_cmp_usage->has_active_component( ) is initial.
    lo_cmp_usage->create_component( ).
  endif.

* get ALV component
  lr_salv_wd_table = wd_this->wd_cpifc_OVERVIEW_RET_ALV( ).
  wd_this->alv_config_table = lr_salv_wd_table->get_model( ).

*  get function settings
  lr_function_settings ?= wd_this->alv_config_table.
   
 CALL METHOD LR_FUNCTION_SETTINGS->IF_SALV_WD_PDF_SETTINGS~SET_HEADER_LEFT_FREETEXT
      EXPORTING
        VALUE = LV_HEADER_TEXT. " lv_header_text is your pdf pring header

Hope this helps

Regards

Manas Dua

Former Member
0 Kudos

Hi Manas,

Thanks for your repply.

Just a question: which type is

wd_this->alv_config_table

ALV_CONFIG_TABLE method?

thanks!

Regards.

Urtzi.

Former Member
0 Kudos

it is of type ref to CL_SALV_WD_CONFIG_TABLE

i was storing it as view attribute in my code

or you can directly get the lr_function_settings referece as

  • get function settings

lr_function_settings ?= lr_salv_wd_table->get_model( ).

Edited by: Manas Dua on Jan 13, 2010 3:29 PM

Former Member
0 Kudos

Any Help?