Skip to content

Font "Libre Barcode 39" not loading #1038

@ramc-v

Description

@ramc-v

I am trying to add barcodes in the spreadsheet by setting the font as "Libre Barcode 39", the font is set as expected but doesn't load when opening in the desktop version of the excel. This loads fine if opened from office online or the web version of office.

Here's a simplified report of what the issue boils down to and to replicate this issue :

DATA: lo_excel                TYPE REF TO zcl_excel.
DATA: lo_worksheet            TYPE REF TO zcl_excel_worksheet.
DATA: lo_style_barcode        TYPE REF TO zcl_excel_style.
DATA: lv_style_barcode        TYPE        zexcel_cell_style.

CONSTANTS: gc_save_file_name TYPE string VALUE 'Barcode_Style.xlsx'.

INCLUDE zdemo_excel_outputopt_incl.

START-OF-SELECTION.

  CREATE OBJECT lo_excel.

  lo_style_barcode                  = lo_excel->add_new_style( ).
  lo_style_barcode->font->name      = 'Libre Barcode 39'.
  lo_style_barcode->font->scheme    = zcl_excel_style_font=>c_scheme_none.
  lo_style_barcode->font->size      = 25.
  lv_style_barcode                  = lo_style_barcode->get_guid( ).

  lo_excel->set_default_style( lv_style_barcode ).

  lo_worksheet = lo_excel->get_active_worksheet( ).
  lo_worksheet->set_title( 'Barcode Style' ).
  lo_worksheet->set_cell( ip_column = 1 ip_row = 1 ip_value = '*ABC123*' ).

  lcl_output=>output( lo_excel ).

I am not sure if we can use a font that is not in zcl_excel? However the cell properties do reflect the font that I set here.
image

The same file opened in the office online excel:
image

Any help?Thanks in advance

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions