[GH-ISSUE #333] Formats in a file other than the main one #269

Closed
opened 2026-05-05 12:03:48 -06:00 by gitea-mirror · 2 comments
Owner

Originally created by @sapomuyverde on GitHub (May 17, 2021).
Original GitHub issue: https://github.com/jmcnamara/libxlsxwriter/issues/333

Originally assigned to: @jmcnamara on GitHub.

Hi,

I am using a libxlsxwriter (harbour) wrapper

I am trying to put the formats in another file independent of the main code, so I try something like this:

main code/file:

workbook  = workbook_new("venta.xlsx")
worksheet = workbook_add_worksheet(workbook, 'venta')

excelFormats(workbook)

worksheet_merge_range(worksheet,  3, 0, 3, 11, "Title", header)  

in another function/file

PROCEDURE excelFormats(workbook)
header = workbook_add_format(workbook)
textLeft = workbook_add_format(workbook)

format_set_bold(header)
format_set_align(header, LXW_ALIGN_CENTER)
format_set_align(header, LXW_ALIGN_VERTICAL_CENTER)
format_set_font_name(header, "Calibri")
format_set_font_size(header,11)

format_set_align(textLeft, LXW_ALIGN_LEFT)
format_set_align(textLeft, LXW_ALIGN_VERTICAL_CENTER)
format_set_font_name(textLeft, "Calibri")
format_set_font_size(textLeft, 09)

but this doesn't work for me, I mean, the formats in the generated Excel file do not take effect, can you please give me an idea how to solve what I require, it doesn't matter that the example is in the C language just to know how to make this implementation.

I appreciate your time.

Regards,
Javier

Originally created by @sapomuyverde on GitHub (May 17, 2021). Original GitHub issue: https://github.com/jmcnamara/libxlsxwriter/issues/333 Originally assigned to: @jmcnamara on GitHub. Hi, I am using a libxlsxwriter (harbour) wrapper I am trying to put the formats in another file independent of the main code, so I try something like this: main code/file: ```harbour workbook = workbook_new("venta.xlsx") worksheet = workbook_add_worksheet(workbook, 'venta') excelFormats(workbook) worksheet_merge_range(worksheet, 3, 0, 3, 11, "Title", header) ``` in another function/file ```harbour PROCEDURE excelFormats(workbook) header = workbook_add_format(workbook) textLeft = workbook_add_format(workbook) format_set_bold(header) format_set_align(header, LXW_ALIGN_CENTER) format_set_align(header, LXW_ALIGN_VERTICAL_CENTER) format_set_font_name(header, "Calibri") format_set_font_size(header,11) format_set_align(textLeft, LXW_ALIGN_LEFT) format_set_align(textLeft, LXW_ALIGN_VERTICAL_CENTER) format_set_font_name(textLeft, "Calibri") format_set_font_size(textLeft, 09) ``` but this doesn't work for me, I mean, the formats in the generated Excel file do not take effect, can you please give me an idea how to solve what I require, it doesn't matter that the example is in the C language just to know how to make this implementation. I appreciate your time. Regards, Javier
Author
Owner

@jmcnamara commented on GitHub (May 17, 2021):

I don't know what the issue is. The code looks fine. If it was in C or Python it would work as expected. Maybe ask on Stackoverflow or ask the maintainer of the Harbour port.

<!-- gh-comment-id:842557001 --> @jmcnamara commented on GitHub (May 17, 2021): I don't know what the issue is. The code looks fine. If it was in C or Python it would work as expected. Maybe ask on Stackoverflow or ask the maintainer of the Harbour port.
Author
Owner

@sapomuyverde commented on GitHub (May 20, 2021):

Thanks for answering, surely it is something related to Harbour, I will contact the author of the wrapper as you suggest.

<!-- gh-comment-id:845528694 --> @sapomuyverde commented on GitHub (May 20, 2021): Thanks for answering, surely it is something related to Harbour, I will contact the author of the wrapper as you suggest.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: github-starred/libxlsxwriter#269
No description provided.