Closed willm132 closed 2 years ago
Like you add a complete sample application that demonstrates the issue.
let workbook = workbook_new(formatURLForIOS)
let worksheet1 = workbook_add_worksheet(workbook, "\(fileName)")
worksheet_center_horizontally(worksheet1)
let standardText = workbook_add_format(workbook)
format_set_font_name(standardText, SETTINGS.reportFont)
let boldTextCustShipLoc = workbook_add_format(workbook)
format_set_font_name(boldTextCustShipLoc, SETTINGS.reportFont)
format_set_text_wrap(standardText)
format_set_text_wrap(boldTextCustShipLoc)
worksheet_merge_range(worksheet1, lxw_row_t(currentRow), 0, lxw_row_t(currentRow), lxw_col_t(totalLength),
"Generated On: \(SETTINGS.fullDateAndTime) ", boldTextCustShipLoc)
currentRow += 1
worksheet_fit_to_pages(worksheet1, 1, 0)
workbook_close(workbook)
Thanks. Could you also attach the output xlsx file.
Also, worksheet_repeat_rows(worksheet1, 5, 5) does nothing when you open with excel and try to print
Sorry, I meant could you attach the xlsx file from the smaller sample program above.
The reason for this Excel error is that there are overlapping merged ranges. Specifically "A97:C97" and "A97:I97".
Libxlsxwriter should warn/prevent overlapping ranges (and it is a planned feature https://github.com/jmcnamara/XlsxWriter/issues/848) but for now try to avoid overlapping merged ranges.
And why does the worksheet_repeat_rows(worksheet1, 5, 5) do nothing when opening in excel?
And why does the worksheet_repeat_rows(worksheet1, 5, 5) do nothing when opening in excel?
It should work. Here is a C example:
#include "xlsxwriter.h"
int main() {
lxw_workbook *workbook = workbook_new("test_repeat.xlsx");
lxw_worksheet *worksheet = workbook_add_worksheet(workbook, "Sheet 1");
worksheet_repeat_rows(worksheet, 5, 5);
worksheet_write_string(worksheet, CELL("A1"), "Foo" , NULL);
return workbook_close(workbook);
}
Output:
However, if you are using xlsxwriter.swift then it may not be supported/ported. I don't see it mentioned in the code.
Using Swift and Xcode
Once you open the document you get this error