mirror of
https://github.com/jmcnamara/libxlsxwriter.git
synced 2026-10-23 08:07:32 -06:00
[GH-ISSUE #519] worksheet_set_start_page() has no effect unless another page-setup function is also called #517
Labels
No labels
awaiting user feedback
bug
cmake
cmake
docs
feature request
in progress
long term
medium term
medium term
pull-request
question
question
ready to close
short term
under investigation
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github-starred/libxlsxwriter#517
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @billdenney on GitHub (Jul 27, 2026).
Original GitHub issue: https://github.com/jmcnamara/libxlsxwriter/issues/519
Originally assigned to: @jmcnamara on GitHub.
worksheet_set_start_page()is silently ignored when it is the only page-setupfunction called on a worksheet. No
<pageSetup>element is written, sofirstPageNumbernever reaches the file. Calling any other page-setup functionalongside it makes it work.
xl/worksheets/sheet1.xmlcontains no<pageSetup>element at all:Adding any other page-setup call —
worksheet_set_landscape(),worksheet_set_paper(),worksheet_set_print_scale()— makesfirstPageNumber="3" useFirstPageNumber="1"appear as expected.Cause
worksheet_set_start_page()does not raisepage_setup_changed, which is whatgates
<pageSetup>:It appears to be the only
<pageSetup>writer that omits the flag —worksheet_set_landscape(),worksheet_set_portrait(),worksheet_set_paper(),worksheet_set_print_scale(),worksheet_print_across()andworksheet_print_black_and_white()all set it.(
worksheet_set_page_view()also omits it, but correctly so: it drives<sheetView view="pageLayout">rather than<pageSetup>, and works on its own.)Suggested fix
I built the reprex against a patched copy to confirm; it then produces:
@jmcnamara commented on GitHub (Jul 27, 2026):
@billdenney Thanks for the report. I'll look into it.