-
-
Notifications
You must be signed in to change notification settings - Fork 1.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add helper to auto scale sheet on page by single, columns and rows options #2108
Labels
kind/documentation
Improvements or additions to documentation
Comments
moisespsena
added a commit
to moisespsena-go/excelize
that referenced
this issue
Mar 21, 2025
…ngle, columns and rows options
moisespsena
added a commit
to moisespsena-go/excelize
that referenced
this issue
Mar 21, 2025
…ngle, columns and rows options - Add new SheetAutoScalingPageMode data type - Add new consts SheetFitOnPage, SheetFitAllColumnsOnPage, SheetFitAllRowsOnPage - Add new function SetSheetAutoScalingPageByMode - Update unit tests
Merged
10 tasks
Thanks for your issue. I've left some comments in PR #2109. These three scaling options can be found in the Excel's print settings drop-down menus: ![]() I will update documentation for this. |
moisespsena
added a commit
to moisespsena-go/excelize
that referenced
this issue
Mar 23, 2025
…, 2) Fit Sheet on One Page and 3) Fit All Columns on One Page
moisespsena
added a commit
to moisespsena-go/excelize
that referenced
this issue
Mar 23, 2025
…) No Scaling; 2) Fit Sheet on One Page; 3) Fit All Columns on One Page; 4) Fit All Rows on One Page
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Description
I have used excelize to generate data sheets for print. In many cases, when have many columns, the MS Excel or WPS SpreadSheets or LibreOffice Calc, add automatic page breaks on columns. This is a bad option for my sheets!
I see what those sheet editors have a page setup for auto scaling with three options for solve these problems: 1) Fit sheet on one page, 2) Fit all columns on one page and 3) Fit all rows on one page. See bellow image:
I notice what this options is a helper to set other sheet options:
SheetPropsOptions.FitToPage = true
SheetPropsOptions.FitToPage = true
andPageLayoutOptions.FitToHeight = 0
SheetPropsOptions.FitToPage = true
andPageLayoutOptions.FitToWidth = 0
I searched excelize api and 5th edition of the ECMA-376 Standard for Office Open XML to set those options on my sheet but i found nothing. For solve this problem, i have created sheets with those options and see the
xl/worksheets/sheet1.xml
file to check the XML attibutes set.Additional context
No response
Validations
The text was updated successfully, but these errors were encountered: