What steps will reproduce the problem?
REPORT zdemo_excel14.
DATA: lo_excel TYPE REF TO zcl_excel,
lo_worksheet TYPE REF TO zcl_excel_worksheet,
lv_file TYPE xstring,
lv_style_center_guid TYPE zexcel_cell_style,
lv_style_right_guid TYPE zexcel_cell_style,
lv_style_left_guid TYPE zexcel_cell_style,
lv_style_general_guid TYPE zexcel_cell_style,
lv_bytecount TYPE i,
lt_file_tab TYPE STANDARD TABLE OF solisti1,
lo_style_center TYPE REF TO zcl_excel_style,
lo_style_right TYPE REF TO zcl_excel_style,
lo_style_left TYPE REF TO zcl_excel_style,
lo_style_general TYPE REF TO zcl_excel_style.
CREATE OBJECT lo_excel.
" Get active sheet
lo_worksheet = lo_excel->get_active_worksheet( ).
lo_worksheet->title = 'sheet1'.
"Center
lo_style_center = lo_excel->add_new_style( ).
lo_style_center->alignment->horizontal = zcl_excel_style_alignment=>c_horizontal_center.
lv_style_center_guid = lo_style_center->get_guid( ).
"Right
lo_style_right = lo_excel->add_new_style( ).
"lo_style_right->alignment->horizontal = zcl_excel_style_alignment=>c_horizontal_right.
lo_style_right->alignment->textrotation = 2.
lv_style_right_guid = lo_style_right->get_guid( ).
"Left
lo_style_left = lo_excel->add_new_style( ).
lo_style_left->alignment->horizontal = zcl_excel_style_alignment=>c_horizontal_left.
lv_style_left_guid = lo_style_left->get_guid( ).
"General
lo_style_general = lo_excel->add_new_style( ).
lo_style_general->alignment->horizontal = zcl_excel_style_alignment=>c_horizontal_general.
lv_style_general_guid = lo_style_general->get_guid( ).
lo_worksheet->set_cell( ip_row = 2 ip_column = 'A' ip_value = 'Test' ).
lo_worksheet->set_cell( ip_row = 2 ip_column = 'B' ip_value = 'Centered Text' ip_style = lv_style_center_guid ).
lo_worksheet->set_cell( ip_row = 3 ip_column = 'B' ip_value = 'Right Text' ip_style = lv_style_right_guid ).
lo_worksheet->set_cell( ip_row = 4 ip_column = 'B' ip_value = 'Left Text' ip_style = lv_style_left_guid ).
lo_worksheet->set_cell( ip_row = 5 ip_column = 'B' ip_value = 'General Text' ip_style = lv_style_general_guid ).
lv_file = lo_excel->save_as( zcl_excel=>c_xlsx ).
"convert to table
CALL FUNCTION 'SCMS_XSTRING_TO_BINARY'
EXPORTING
buffer = lv_file
IMPORTING
output_length = lv_bytecount
TABLES
binary_tab = lt_file_tab.
"Save the file
CALL FUNCTION 'GUI_DOWNLOAD'
EXPORTING
bin_filesize = lv_bytecount
filename = 'C:\Alignment.xlsx'
filetype = 'BIN'
TABLES
data_tab = lt_file_tab.
What is the expected output? What do you see instead?
'Right text' in horizontal direction.
What version of the nugg are you using?
Provide the version of the following components?
SAP_BASIS 700
SAP_ABA 700
Please provide any additional information below.
I tried to change the direction of the text to vertical direction using:
lo_style_right->alignment->textrotation = 2.
But it doesn't work. I have noticed, that you have implemented the alignment class just few days ago. Does it mean that the text rotation hasn't been implemented yet or am I doing anything wrong?
Are you going to implement 'Freezing panes' in future?
Best regards
Ivo