Skip to content
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

Applying new settings - default zoom, hide grid lines, landscape orientation #59

Open
saravmajestic opened this issue Apr 19, 2016 · 0 comments

Comments

@saravmajestic
Copy link

Thanks for this library. Works nicely

I am sharing my learnings here on how to apply different settings using this library.

  1. Changing from default 'portrait' view to 'landscape'
    In Sheet.prototype.toxml, change the orientation to landscape like this ws.ele('pageSetup', { paperSize: '9', orientation: 'landscape', horizontalDpi: '200', verticalDpi: '200' });

  2. For fitting all the content in single page while printing (In excel, you can do this using 'Page setup' option)
    Use the below code in Sheet.prototype.toxml as first element in the xml (just above dimension attribute)
    ws.ele('sheetPr', {}).ele('pageSetUpPr', { fitToPage:1 });

  3. Hide grid lines and set default zoom level
    ws.ele('sheetViews').ele('sheetView', { workbookViewId: '0', showGridLines:"0", zoomScaleNormal: 50, zoomScale:50 });

Hope this will be useful for somebody.

pietersv added a commit to protobi/msexcel-builder that referenced this issue Aug 24, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant