From a5e4bb9c7787c3b722c6a50c7640c2f6baa4a3d5 Mon Sep 17 00:00:00 2001 From: Gregor Wolf Date: Sun, 2 Jan 2022 12:05:16 +0100 Subject: [PATCH] add column for photographer, improve formatting (#943) * add column for photographer, improve formatting * Update src/demos/zdemo_calendar.prog.abap Co-authored-by: sandraros <34005250+sandraros@users.noreply.github.com> * Update src/demos/zdemo_calendar.prog.abap Co-authored-by: sandraros <34005250+sandraros@users.noreply.github.com> Co-authored-by: sandraros <34005250+sandraros@users.noreply.github.com> --- src/demos/zdemo_calendar.prog.abap | 38 +++++++++++++++------- src/demos/zdemo_calendar.prog.xml | 4 +-- src/demos/zdemo_calendar_classes.prog.abap | 2 +- 3 files changed, 29 insertions(+), 15 deletions(-) diff --git a/src/demos/zdemo_calendar.prog.abap b/src/demos/zdemo_calendar.prog.abap index 76ef8c0..992ea10 100644 --- a/src/demos/zdemo_calendar.prog.abap +++ b/src/demos/zdemo_calendar.prog.abap @@ -12,6 +12,7 @@ *& Image Filename *& Image Description *& URL for the Description +*& Photographer *& *& The Images should be landscape JPEG's with a 3:2 ratio and min. *& 450 pixel height. They must also be saved in the Export Directory. @@ -33,8 +34,8 @@ PARAMETERS: p_from TYPE dfrom, p_to TYPE dto. SELECTION-SCREEN BEGIN OF BLOCK orientation WITH FRAME TITLE orient. -PARAMETERS: p_portr TYPE flag RADIOBUTTON GROUP orie, - p_lands TYPE flag RADIOBUTTON GROUP orie DEFAULT 'X'. + PARAMETERS: p_portr TYPE flag RADIOBUTTON GROUP orie, + p_lands TYPE flag RADIOBUTTON GROUP orie DEFAULT 'X'. SELECTION-SCREEN END OF BLOCK orientation. INITIALIZATION. @@ -61,6 +62,8 @@ START-OF-SELECTION. lv_style_border_guid TYPE zexcel_cell_style. DATA: lo_style_center TYPE REF TO zcl_excel_style, lv_style_center_guid TYPE zexcel_cell_style. + DATA: lo_style_right TYPE REF TO zcl_excel_style, + lv_style_right_guid TYPE zexcel_cell_style. DATA: lv_full_path TYPE string, image_descr_path TYPE string, @@ -88,10 +91,11 @@ START-OF-SELECTION. FIELD-SYMBOLS: LIKE LINE OF month_names. TYPES: BEGIN OF tt_datatab, - month_nr TYPE fcmnr, - filename TYPE string, - descr TYPE string, - url TYPE string, + month_nr TYPE fcmnr, + filename TYPE string, + descr TYPE string, + url TYPE string, + photographer TYPE string, END OF tt_datatab. DATA: image_descriptions TYPE TABLE OF tt_datatab. @@ -154,11 +158,7 @@ START-OF-SELECTION. " Create Styles " Create an underline double style lo_style_month = lo_excel->add_new_style( ). - " lo_style_month->font->underline = abap_true. - " lo_style_month->font->underline_mode = zcl_excel_style_font=>c_underline_single. - lo_style_month->font->name = zcl_excel_style_font=>c_name_roman. - lo_style_month->font->scheme = zcl_excel_style_font=>c_scheme_none. - lo_style_month->font->family = zcl_excel_style_font=>c_family_roman. + lo_style_month->alignment->horizontal = zcl_excel_style_alignment=>c_horizontal_right. lo_style_month->font->bold = abap_true. lo_style_month->font->size = 36. lv_style_month_guid = lo_style_month->get_guid( ). @@ -177,6 +177,10 @@ START-OF-SELECTION. lo_style_center->alignment->horizontal = zcl_excel_style_alignment=>c_horizontal_center. lo_style_center->alignment->vertical = zcl_excel_style_alignment=>c_vertical_top. lv_style_center_guid = lo_style_center->get_guid( ). + "Create style alignment right + lo_style_right = lo_excel->add_new_style( ). + lo_style_right->alignment->horizontal = zcl_excel_style_alignment=>c_horizontal_right. + lv_style_right_guid = lo_style_right->get_guid( ). " Get Month Names CALL FUNCTION 'MONTH_NAMES_GET' @@ -307,7 +311,17 @@ START-OF-SELECTION. ENDIF. lo_row = lo_worksheet->get_row( row ). lo_row->set_row_height( '22.0' ). - + " Photographer + IF NOT -photographer IS INITIAL. + value = -photographer. + lo_worksheet->set_cell( + EXPORTING + ip_column = to_col_end " Cell Column + ip_row = row " Cell Row + ip_value = value " Cell Value + ip_style = lv_style_right_guid + ). + ENDIF. " In Landscape mode the row between the description and the " dates should be not so high IF p_lands = abap_true. diff --git a/src/demos/zdemo_calendar.prog.xml b/src/demos/zdemo_calendar.prog.xml index c266e88..b025e2e 100644 --- a/src/demos/zdemo_calendar.prog.xml +++ b/src/demos/zdemo_calendar.prog.xml @@ -26,7 +26,7 @@ I 002 - Created with abap2xlsx. Find more information at https://github.com/abap2xlsx/abap2xlsx. + Created with https://github.com/abap2xlsx/abap2xlsx 132 @@ -84,7 +84,7 @@ I 002 - Erzeugt mit abap2xlsx. Weitere Informationen unter https://github.com/abap2xlsx/abap2xlsx. + Erzeugt mit https://github.com/abap2xlsx/abap2xlsx 132 diff --git a/src/demos/zdemo_calendar_classes.prog.abap b/src/demos/zdemo_calendar_classes.prog.abap index 1e9ef3e..106f9a6 100644 --- a/src/demos/zdemo_calendar_classes.prog.abap +++ b/src/demos/zdemo_calendar_classes.prog.abap @@ -347,7 +347,7 @@ CLASS zcl_helper IMPLEMENTATION. DATA: value TYPE string, hyperlink TYPE REF TO zcl_excel_hyperlink. - value = 'Created with abap2xlsx. Find more information at https://github.com/abap2xlsx/abap2xlsx.'(002). + value = 'Created with https://github.com/abap2xlsx/abap2xlsx'(002). hyperlink = zcl_excel_hyperlink=>create_external_link( 'https://github.com/abap2xlsx/abap2xlsx' ). "#EC NOTEXT c_worksheet->set_cell( EXPORTING