mirror of
https://github.com/abap2xlsx/abap2xlsx.git
synced 2025-05-08 04:43:18 +08:00
Merge branch 'main' into patch-1
This commit is contained in:
commit
78b12f4a0e
|
@ -1,17 +1,21 @@
|
|||
# Publishing a new release
|
||||
|
||||
Let's create a release from time to time, every 1 or 2 months for instance, to contain enough changes, but not too much.
|
||||
Before beginning, you should ensure that ZDEMO_EXCEL_CHECKER (in the demos repo) shows all green checkmarks.
|
||||
|
||||
Below are the notes taken while publishing the release `7.15.0`.
|
||||
Below are the notes taken while publishing the release `7.16.0`.
|
||||
|
||||
Version numbering is based on [Semantic Versioning 2.0.0](https://semver.org/):
|
||||
- `7`: a major release. NB: it will probably not change as we don't want to "make incompatible API changes".
|
||||
- `15`: a minor release
|
||||
- `16`: a minor release
|
||||
- `0`: patch level (bug fixes)
|
||||
|
||||
Create a branch for this new release, change `zcl_excel_version` to indicate the new version number and push the changes to the repository
|
||||
Working directly on the upstream repository:
|
||||
- create a branch for this new release; suggested naming for the branch: your own prefix - slash - release - number. For example: abo/release7.16.0 OR sandraros/release7.16.0
|
||||
- change `version` in `zcl_excel` to indicate the new version number
|
||||
- push the changes to this new release branch
|
||||
|
||||
With GitHub Desktop (or any Git console or Git user interface), [add the tag](https://docs.github.com/en/desktop/contributing-and-collaborating-using-github-desktop/managing-commits/managing-tags) `7.15.0` to this branch.
|
||||
With GitHub Desktop (or any Git console or Git user interface), [add the (lightweight) tag](https://docs.github.com/en/desktop/contributing-and-collaborating-using-github-desktop/managing-commits/managing-tags) `v7.16.0` to this branch; suggested naming for version-related tags is v + version number.
|
||||
|
||||
Do a pull request.
|
||||
|
||||
|
@ -21,7 +25,7 @@ Now [create the release in GitHub](https://docs.github.com/en/repositories/relea
|
|||
- Click "Releases"
|
||||
- Click "Draft a new release"
|
||||
- Click "Choose a tag"
|
||||
- Type the title, click "Auto-generate release notes" and click "Preview" to verify; you should have a list with the following items, edit as required:
|
||||
- Type the title, select the previous tag, click "Auto-generate release notes" and click "Preview" to verify; you should have a list with the changes from the previous release, edit as required and remember to include the list below as explanation:
|
||||
- `+`: new feature
|
||||
- `*`: bug fix
|
||||
- `!`: feature modification
|
||||
|
@ -29,3 +33,6 @@ Now [create the release in GitHub](https://docs.github.com/en/repositories/relea
|
|||
- Click "Publish release"
|
||||
- It's done, zip and tar.gz files are automatically assigned to the release
|
||||
- The new release appears in the Code home page, with the changelog in the release page itself.
|
||||
|
||||
Now create a release for the [demos](https://github.com/abap2xlsx/demos) repository as well: use the same process and tag the latest commit available at the time the main library is released, to ensure users will always have a matching set of demo programs.
|
||||
|
||||
|
|
|
@ -13,7 +13,7 @@ CLASS zcl_excel DEFINITION
|
|||
DATA legacy_palette TYPE REF TO zcl_excel_legacy_palette READ-ONLY .
|
||||
DATA security TYPE REF TO zcl_excel_security .
|
||||
DATA use_template TYPE abap_bool .
|
||||
CONSTANTS version TYPE c LENGTH 10 VALUE '7.15.0'. "#EC NOTEXT
|
||||
CONSTANTS version TYPE c LENGTH 10 VALUE '7.16.0'. "#EC NOTEXT
|
||||
|
||||
METHODS add_new_autofilter
|
||||
IMPORTING
|
||||
|
|
|
@ -674,6 +674,15 @@ CLASS zcl_excel_worksheet DEFINITION
|
|||
RAISING
|
||||
zcx_excel .
|
||||
PROTECTED SECTION.
|
||||
METHODS set_table_reference
|
||||
IMPORTING
|
||||
!ip_column TYPE zexcel_cell_column
|
||||
!ip_row TYPE zexcel_cell_row
|
||||
!ir_table TYPE REF TO zcl_excel_table
|
||||
!ip_fieldname TYPE zexcel_fieldname
|
||||
!ip_header TYPE abap_bool
|
||||
RAISING
|
||||
zcx_excel .
|
||||
PRIVATE SECTION.
|
||||
|
||||
*"* private components of class ZCL_EXCEL_WORKSHEET
|
||||
|
@ -1056,14 +1065,20 @@ CLASS zcl_excel_worksheet IMPLEMENTATION.
|
|||
IF <ls_field_catalog>-style_header IS NOT INITIAL.
|
||||
me->set_cell( ip_column = lv_column_alpha
|
||||
ip_row = lv_row_int
|
||||
ip_value = <ls_field_catalog>-scrtext_l
|
||||
ip_value = <ls_field_catalog>-column_name
|
||||
ip_style = <ls_field_catalog>-style_header ).
|
||||
ELSE.
|
||||
me->set_cell( ip_column = lv_column_alpha
|
||||
ip_row = lv_row_int
|
||||
ip_value = <ls_field_catalog>-scrtext_l ).
|
||||
ip_value = <ls_field_catalog>-column_name ).
|
||||
ENDIF.
|
||||
|
||||
me->set_table_reference( ip_column = lv_column_int
|
||||
ip_row = lv_row_int
|
||||
ir_table = lo_table
|
||||
ip_fieldname = <ls_field_catalog>-fieldname
|
||||
ip_header = abap_true ).
|
||||
|
||||
IF <ls_field_catalog>-column_formula IS NOT INITIAL.
|
||||
ls_column_formula-id = lines( column_formulas ) + 1.
|
||||
ls_column_formula-column = lv_column_int.
|
||||
|
@ -1174,7 +1189,7 @@ CLASS zcl_excel_worksheet IMPLEMENTATION.
|
|||
" totals
|
||||
*--------------------------------------------------------------------*
|
||||
IF <ls_field_catalog>-totals_function IS NOT INITIAL.
|
||||
lv_formula = lo_table->get_totals_formula( ip_column = <ls_field_catalog>-scrtext_l ip_function = <ls_field_catalog>-totals_function ).
|
||||
lv_formula = lo_table->get_totals_formula( ip_column = <ls_field_catalog>-column_name ip_function = <ls_field_catalog>-totals_function ).
|
||||
IF <ls_field_catalog>-style_total IS NOT INITIAL.
|
||||
me->set_cell( ip_column = lv_column_alpha
|
||||
ip_row = lv_row_int
|
||||
|
@ -3301,7 +3316,7 @@ CLASS zcl_excel_worksheet IMPLEMENTATION.
|
|||
|
||||
DATA: lt_field_catalog TYPE zexcel_t_fieldcatalog,
|
||||
lv_value_lowercase TYPE string,
|
||||
lv_scrtext_l_initial TYPE scrtext_l,
|
||||
lv_scrtext_l_initial TYPE zexcel_column_name,
|
||||
lv_long_text TYPE string,
|
||||
lv_max_length TYPE i,
|
||||
lv_temp_length TYPE i,
|
||||
|
@ -3320,39 +3335,42 @@ CLASS zcl_excel_worksheet IMPLEMENTATION.
|
|||
|
||||
LOOP AT lt_field_catalog ASSIGNING <ls_field_catalog> WHERE dynpfld EQ abap_true.
|
||||
|
||||
CASE iv_default_descr.
|
||||
WHEN 'M'.
|
||||
ASSIGN <ls_field_catalog>-scrtext_m TO <scrtxt1>.
|
||||
ASSIGN <ls_field_catalog>-scrtext_s TO <scrtxt2>.
|
||||
ASSIGN <ls_field_catalog>-scrtext_l TO <scrtxt3>.
|
||||
WHEN 'S'.
|
||||
ASSIGN <ls_field_catalog>-scrtext_s TO <scrtxt1>.
|
||||
ASSIGN <ls_field_catalog>-scrtext_m TO <scrtxt2>.
|
||||
ASSIGN <ls_field_catalog>-scrtext_l TO <scrtxt3>.
|
||||
WHEN 'L'.
|
||||
ASSIGN <ls_field_catalog>-scrtext_l TO <scrtxt1>.
|
||||
ASSIGN <ls_field_catalog>-scrtext_m TO <scrtxt2>.
|
||||
ASSIGN <ls_field_catalog>-scrtext_s TO <scrtxt3>.
|
||||
WHEN OTHERS.
|
||||
ASSIGN <ls_field_catalog>-scrtext_m TO <scrtxt1>.
|
||||
ASSIGN <ls_field_catalog>-scrtext_s TO <scrtxt2>.
|
||||
ASSIGN <ls_field_catalog>-scrtext_l TO <scrtxt3>.
|
||||
ENDCASE.
|
||||
IF <ls_field_catalog>-column_name IS INITIAL.
|
||||
|
||||
IF <scrtxt1> IS NOT INITIAL.
|
||||
<ls_field_catalog>-scrtext_l = <scrtxt1>.
|
||||
ELSEIF <scrtxt2> IS NOT INITIAL.
|
||||
<ls_field_catalog>-scrtext_l = <scrtxt2>.
|
||||
ELSEIF <scrtxt3> IS NOT INITIAL.
|
||||
<ls_field_catalog>-scrtext_l = <scrtxt3>.
|
||||
ELSE.
|
||||
<ls_field_catalog>-scrtext_l = 'Column'. " default value as Excel does
|
||||
CASE iv_default_descr.
|
||||
WHEN 'M'.
|
||||
ASSIGN <ls_field_catalog>-scrtext_m TO <scrtxt1>.
|
||||
ASSIGN <ls_field_catalog>-scrtext_s TO <scrtxt2>.
|
||||
ASSIGN <ls_field_catalog>-scrtext_l TO <scrtxt3>.
|
||||
WHEN 'S'.
|
||||
ASSIGN <ls_field_catalog>-scrtext_s TO <scrtxt1>.
|
||||
ASSIGN <ls_field_catalog>-scrtext_m TO <scrtxt2>.
|
||||
ASSIGN <ls_field_catalog>-scrtext_l TO <scrtxt3>.
|
||||
WHEN 'L'.
|
||||
ASSIGN <ls_field_catalog>-scrtext_l TO <scrtxt1>.
|
||||
ASSIGN <ls_field_catalog>-scrtext_m TO <scrtxt2>.
|
||||
ASSIGN <ls_field_catalog>-scrtext_s TO <scrtxt3>.
|
||||
WHEN OTHERS.
|
||||
ASSIGN <ls_field_catalog>-scrtext_m TO <scrtxt1>.
|
||||
ASSIGN <ls_field_catalog>-scrtext_s TO <scrtxt2>.
|
||||
ASSIGN <ls_field_catalog>-scrtext_l TO <scrtxt3>.
|
||||
ENDCASE.
|
||||
|
||||
IF <scrtxt1> IS NOT INITIAL.
|
||||
<ls_field_catalog>-column_name = <scrtxt1>.
|
||||
ELSEIF <scrtxt2> IS NOT INITIAL.
|
||||
<ls_field_catalog>-column_name = <scrtxt2>.
|
||||
ELSEIF <scrtxt3> IS NOT INITIAL.
|
||||
<ls_field_catalog>-column_name = <scrtxt3>.
|
||||
ELSE.
|
||||
<ls_field_catalog>-column_name = 'Column'. " default value as Excel does
|
||||
ENDIF.
|
||||
ENDIF.
|
||||
|
||||
lv_scrtext_l_initial = <ls_field_catalog>-scrtext_l.
|
||||
DESCRIBE FIELD <ls_field_catalog>-scrtext_l LENGTH lv_max_length IN CHARACTER MODE.
|
||||
lv_scrtext_l_initial = <ls_field_catalog>-column_name.
|
||||
DESCRIBE FIELD <ls_field_catalog>-column_name LENGTH lv_max_length IN CHARACTER MODE.
|
||||
DO.
|
||||
lv_value_lowercase = <ls_field_catalog>-scrtext_l.
|
||||
lv_value_lowercase = <ls_field_catalog>-column_name.
|
||||
TRANSLATE lv_value_lowercase TO LOWER CASE.
|
||||
READ TABLE lt_column_name_buffer TRANSPORTING NO FIELDS WITH KEY table_line = lv_value_lowercase BINARY SEARCH.
|
||||
IF sy-subrc <> 0.
|
||||
|
@ -3362,11 +3380,11 @@ CLASS zcl_excel_worksheet IMPLEMENTATION.
|
|||
lv_syindex = sy-index.
|
||||
CONCATENATE lv_scrtext_l_initial lv_syindex INTO lv_long_text.
|
||||
IF strlen( lv_long_text ) <= lv_max_length.
|
||||
<ls_field_catalog>-scrtext_l = lv_long_text.
|
||||
<ls_field_catalog>-column_name = lv_long_text.
|
||||
ELSE.
|
||||
lv_temp_length = strlen( lv_scrtext_l_initial ) - 1.
|
||||
lv_scrtext_l_initial = substring( val = lv_scrtext_l_initial len = lv_temp_length ).
|
||||
CONCATENATE lv_scrtext_l_initial lv_syindex INTO <ls_field_catalog>-scrtext_l.
|
||||
CONCATENATE lv_scrtext_l_initial lv_syindex INTO <ls_field_catalog>-column_name.
|
||||
ENDIF.
|
||||
ENDIF.
|
||||
ENDDO.
|
||||
|
@ -3836,7 +3854,7 @@ CLASS zcl_excel_worksheet IMPLEMENTATION.
|
|||
<fs_value> TYPE simple,
|
||||
<fs_typekind_int8> TYPE abap_typekind.
|
||||
FIELD-SYMBOLS: <fs_column_formula> TYPE mty_s_column_formula.
|
||||
|
||||
FIELD-SYMBOLS: <ls_fieldcat> TYPE zexcel_s_fieldcatalog.
|
||||
|
||||
IF ip_value IS NOT SUPPLIED
|
||||
AND ip_formula IS NOT SUPPLIED
|
||||
|
@ -3979,6 +3997,16 @@ CLASS zcl_excel_worksheet IMPLEMENTATION.
|
|||
ENDCASE.
|
||||
ENDIF.
|
||||
|
||||
IF <fs_sheet_content> IS ASSIGNED AND <fs_sheet_content>-table_header IS NOT INITIAL AND lv_value IS NOT INITIAL.
|
||||
READ TABLE <fs_sheet_content>-table->fieldcat ASSIGNING <ls_fieldcat> WITH KEY fieldname = <fs_sheet_content>-table_fieldname.
|
||||
IF sy-subrc = 0.
|
||||
<ls_fieldcat>-column_name = lv_value.
|
||||
IF <ls_fieldcat>-column_name <> lv_value.
|
||||
zcx_excel=>raise_text( 'Cell is table column header - this value is not allowed' ).
|
||||
ENDIF.
|
||||
ENDIF.
|
||||
ENDIF.
|
||||
|
||||
ENDIF.
|
||||
|
||||
IF ip_hyperlink IS BOUND.
|
||||
|
@ -4149,6 +4177,23 @@ CLASS zcl_excel_worksheet IMPLEMENTATION.
|
|||
ENDMETHOD. "SET_CELL_STYLE
|
||||
|
||||
|
||||
METHOD set_table_reference.
|
||||
|
||||
FIELD-SYMBOLS: <ls_sheet_content> TYPE zexcel_s_cell_data.
|
||||
|
||||
READ TABLE sheet_content ASSIGNING <ls_sheet_content> WITH KEY cell_row = ip_row
|
||||
cell_column = ip_column.
|
||||
IF sy-subrc = 0.
|
||||
<ls_sheet_content>-table = ir_table.
|
||||
<ls_sheet_content>-table_fieldname = ip_fieldname.
|
||||
<ls_sheet_content>-table_header = ip_header.
|
||||
ELSE.
|
||||
zcx_excel=>raise_text( 'Cell not found' ).
|
||||
ENDIF.
|
||||
|
||||
ENDMETHOD.
|
||||
|
||||
|
||||
METHOD set_column_width.
|
||||
DATA: lo_column TYPE REF TO zcl_excel_column.
|
||||
DATA: width TYPE f.
|
||||
|
|
|
@ -7432,7 +7432,8 @@ CLASS zcl_excel_writer_2007 IMPLEMENTATION.
|
|||
SHIFT lv_value LEFT DELETING LEADING '0'.
|
||||
lo_element2->set_attribute_ns( name = 'id'
|
||||
value = lv_value ).
|
||||
lv_value = ls_fieldcat-scrtext_l.
|
||||
|
||||
lv_value = ls_fieldcat-column_name.
|
||||
|
||||
" The text "_x...._", with "_x" not "_X", with exactly 4 ".", each being 0-9 a-f or A-F (case insensitive), is interpreted
|
||||
" like Unicode character U+.... (e.g. "_x0041_" is rendered like "A") is for characters.
|
||||
|
@ -7469,8 +7470,8 @@ CLASS zcl_excel_writer_2007 IMPLEMENTATION.
|
|||
ENDLOOP.
|
||||
|
||||
|
||||
lo_element = lo_document->create_simple_element( name = 'tableStyleInfo'
|
||||
parent = lo_element_root ).
|
||||
lo_element = lo_document->create_simple_element( name = 'tableStyleInfo'
|
||||
parent = lo_element_root ).
|
||||
|
||||
lo_element->set_attribute_ns( name = 'name'
|
||||
value = io_table->settings-table_style ).
|
||||
|
|
24
src/zexcel_column_name.dtel.xml
Normal file
24
src/zexcel_column_name.dtel.xml
Normal file
|
@ -0,0 +1,24 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<abapGit version="v1.0.0" serializer="LCL_OBJECT_DTEL" serializer_version="v1.0.0">
|
||||
<asx:abap xmlns:asx="http://www.sap.com/abapxml" version="1.0">
|
||||
<asx:values>
|
||||
<DD04V>
|
||||
<ROLLNAME>ZEXCEL_COLUMN_NAME</ROLLNAME>
|
||||
<DDLANGUAGE>E</DDLANGUAGE>
|
||||
<HEADLEN>15</HEADLEN>
|
||||
<SCRLEN1>10</SCRLEN1>
|
||||
<SCRLEN2>11</SCRLEN2>
|
||||
<SCRLEN3>16</SCRLEN3>
|
||||
<DDTEXT>Cell Column</DDTEXT>
|
||||
<REPTEXT>Column Name</REPTEXT>
|
||||
<SCRTEXT_S>ColumnName</SCRTEXT_S>
|
||||
<SCRTEXT_M>Column Name</SCRTEXT_M>
|
||||
<SCRTEXT_L>Column Name</SCRTEXT_L>
|
||||
<DTELMASTER>E</DTELMASTER>
|
||||
<DATATYPE>CHAR</DATATYPE>
|
||||
<LENG>000255</LENG>
|
||||
<OUTPUTLEN>000255</OUTPUTLEN>
|
||||
</DD04V>
|
||||
</asx:values>
|
||||
</asx:abap>
|
||||
</abapGit>
|
|
@ -71,6 +71,29 @@
|
|||
<MASK> TTYPL</MASK>
|
||||
<COMPTYPE>L</COMPTYPE>
|
||||
</DD03P>
|
||||
<DD03P>
|
||||
<FIELDNAME>TABLE</FIELDNAME>
|
||||
<ROLLNAME>ZCL_EXCEL_TABLE</ROLLNAME>
|
||||
<ADMINFIELD>0</ADMINFIELD>
|
||||
<DATATYPE>REF</DATATYPE>
|
||||
<MASK> REF RC</MASK>
|
||||
<COMPTYPE>R</COMPTYPE>
|
||||
<REFTYPE>C</REFTYPE>
|
||||
</DD03P>
|
||||
<DD03P>
|
||||
<FIELDNAME>TABLE_FIELDNAME</FIELDNAME>
|
||||
<ROLLNAME>ZEXCEL_FIELDNAME</ROLLNAME>
|
||||
<ADMINFIELD>0</ADMINFIELD>
|
||||
<COMPTYPE>E</COMPTYPE>
|
||||
</DD03P>
|
||||
<DD03P>
|
||||
<FIELDNAME>TABLE_HEADER</FIELDNAME>
|
||||
<ROLLNAME>FLAG</ROLLNAME>
|
||||
<ADMINFIELD>0</ADMINFIELD>
|
||||
<VALEXI>X</VALEXI>
|
||||
<SHLPORIGIN>F</SHLPORIGIN>
|
||||
<COMPTYPE>E</COMPTYPE>
|
||||
</DD03P>
|
||||
</DD03P_TABLE>
|
||||
</asx:values>
|
||||
</asx:abap>
|
||||
|
|
|
@ -111,6 +111,12 @@
|
|||
<MASK> STRG</MASK>
|
||||
<DDTEXT>Column Formula</DDTEXT>
|
||||
</DD03P>
|
||||
<DD03P>
|
||||
<FIELDNAME>COLUMN_NAME</FIELDNAME>
|
||||
<ROLLNAME>ZEXCEL_COLUMN_NAME</ROLLNAME>
|
||||
<ADMINFIELD>0</ADMINFIELD>
|
||||
<COMPTYPE>E</COMPTYPE>
|
||||
</DD03P>
|
||||
</DD03P_TABLE>
|
||||
</asx:values>
|
||||
</asx:abap>
|
||||
|
|
Loading…
Reference in New Issue
Block a user