Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

+ worksheet columns right-to-left #911

Merged
merged 2 commits into from
Dec 12, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions src/zcl_excel_reader_2007.clas.abap
Original file line number Diff line number Diff line change
Expand Up @@ -2212,6 +2212,7 @@ CLASS zcl_excel_reader_2007 IMPLEMENTATION.
zoomscalenormal TYPE string,
workbookviewid TYPE string,
showrowcolheaders TYPE string,
righttoleft TYPE string,
END OF lty_sheetview.

TYPES: BEGIN OF lty_mergecell,
Expand Down Expand Up @@ -2728,6 +2729,10 @@ CLASS zcl_excel_reader_2007 IMPLEMENTATION.
ls_sheetview-showgridlines = abap_false.
ENDIF.
io_worksheet->set_show_gridlines( ls_sheetview-showgridlines ).
IF ls_sheetview-righttoleft = lc_xml_attr_true
OR ls_sheetview-righttoleft = lc_xml_attr_true_int.
io_worksheet->zif_excel_sheet_properties~set_right_to_left( abap_true ).
ENDIF.


"Add merge cell information
Expand Down
11 changes: 11 additions & 0 deletions src/zcl_excel_worksheet.clas.abap
Original file line number Diff line number Diff line change
Expand Up @@ -667,6 +667,7 @@ CLASS zcl_excel_worksheet DEFINITION
DATA title TYPE zexcel_sheet_title VALUE 'Worksheet'. "#EC NOTEXT . . . . . . . . . . . . . . . . . . . . . . . . . . . . " .
DATA upper_cell TYPE zexcel_s_cell_data .
DATA mt_ignored_errors TYPE mty_th_ignored_errors.
DATA right_to_left TYPE abap_bool.

METHODS calculate_cell_width
IMPORTING
Expand Down Expand Up @@ -4260,6 +4261,11 @@ CLASS zcl_excel_worksheet IMPLEMENTATION.
ENDMETHOD. "ZIF_EXCEL_SHEET_PRINTSETTINGS~SET_PRINT_REPEAT_ROWS


METHOD zif_excel_sheet_properties~get_right_to_left.
result = right_to_left.
ENDMETHOD.


METHOD zif_excel_sheet_properties~get_style.
IF zif_excel_sheet_properties~style IS NOT INITIAL.
ep_style = zif_excel_sheet_properties~style.
Expand All @@ -4283,6 +4289,11 @@ CLASS zcl_excel_worksheet IMPLEMENTATION.
ENDMETHOD. "ZIF_EXCEL_SHEET_PROPERTIES~INITIALIZE


METHOD zif_excel_sheet_properties~set_right_to_left.
me->right_to_left = right_to_left.
ENDMETHOD.


METHOD zif_excel_sheet_properties~set_style.
zif_excel_sheet_properties~style = ip_style.
ENDMETHOD. "ZIF_EXCEL_SHEET_PROPERTIES~SET_STYLE
Expand Down
4 changes: 4 additions & 0 deletions src/zcl_excel_writer_2007.clas.abap
Original file line number Diff line number Diff line change
Expand Up @@ -4088,6 +4088,10 @@ CLASS zcl_excel_writer_2007 IMPLEMENTATION.
lo_element_2->set_attribute_ns( name = lc_xml_attr_zoomscalesheetview
value = lv_value ).
ENDIF.
IF io_worksheet->zif_excel_sheet_properties~get_right_to_left( ) EQ abap_true.
lo_element_2->set_attribute_ns( name = 'rightToLeft'
value = '1' ).
ENDIF.
lo_element_2->set_attribute_ns( name = lc_xml_attr_workbookviewid
value = '0' ).
" showGridLines attribute
Expand Down
7 changes: 7 additions & 0 deletions src/zcl_excel_writer_huge_file.clas.abap
Original file line number Diff line number Diff line change
Expand Up @@ -209,6 +209,7 @@ CLASS zcl_excel_writer_huge_file IMPLEMENTATION.
zoomscalenormal TYPE i,
zoomscalepageview TYPE i,
zoomscalesheetview TYPE i,
righttoleft TYPE i,
workbookviewid TYPE c,
showgridlines TYPE c,
showrowcolheaders TYPE c,
Expand Down Expand Up @@ -380,6 +381,12 @@ CLASS zcl_excel_writer_huge_file IMPLEMENTATION.
l_worksheet-zoomscalesheetview = io_worksheet->zif_excel_sheet_properties~zoomscale_sheetlayoutview.
ENDIF.

IF io_worksheet->zif_excel_sheet_properties~get_right_to_left( ) EQ abap_true.
l_worksheet-righttoleft = lc_one.
ELSE.
l_worksheet-righttoleft = lc_zero.
ENDIF.

l_worksheet-workbookviewid = lc_zero.

IF io_worksheet->show_gridlines = abap_true.
Expand Down
1 change: 1 addition & 0 deletions src/zexcel_tr_sheet.xslt.source.xml
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@
<tt:attribute name="zoomScalePageLayoutView" value-ref="WORKSHEET.ZOOMSCALEPAGEVIEW" />
</tt:cond>
<tt:attribute name="zoomScaleSheetLayoutView" value-ref="WORKSHEET.ZOOMSCALESHEETVIEW" />
<tt:attribute name="rightToLeft" value-ref="WORKSHEET.RIGHTTOLEFT" />
<tt:attribute name="workbookViewId" value-ref="WORKSHEET.WORKBOOKVIEWID" />
<tt:attribute name="showGridLines" value-ref="WORKSHEET.SHOWGRIDLINES" />
<tt:attribute name="showRowColHeaders" value-ref="WORKSHEET.SHOWROWCOLHEADERS" />
Expand Down
6 changes: 6 additions & 0 deletions src/zif_excel_sheet_properties.intf.abap
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,15 @@ INTERFACE zif_excel_sheet_properties
DATA hide_columns_from TYPE zexcel_cell_column_alpha .

METHODS initialize .
METHODS get_right_to_left
RETURNING
VALUE(result) TYPE abap_bool.
METHODS get_style
RETURNING
VALUE(ep_style) TYPE zexcel_cell_style .
METHODS set_right_to_left
IMPORTING
!right_to_left TYPE abap_bool .
METHODS set_style
IMPORTING
!ip_style TYPE zexcel_cell_style .
Expand Down