Table of Contents

Class SpreadsheetLayout

Namespace
DocWright.Spreadsheet.Rendering
Assembly
DocWright.Spreadsheet.Rendering.dll

Lays a worksheet of an opened workbook out on pages as Excel prints it, as the layout document DocWright's PDF and image renderers draw.

public static class SpreadsheetLayout
Inheritance
SpreadsheetLayout
Inherited Members

Remarks

The pages hold the cells Excel's own print of the sheet holds: the sheet's paper, orientation and margins, its print area (or everything it uses), its scale or its fit to a number of pages, its manual breaks, its repeated title rows and columns, the order of its pages, its centring, and its header and footer. Each cell is drawn with the text Excel shows for it (XlsxNumberFormatter), its font, its alignment, its fill and its borders; text too long for its cell runs over the empty cells beside it, a number too wide for its column is a run of #, wrapped text is broken into lines, a merged range is one box.

Sizes are Excel's own (measured in Phase 192): Excel draws a printed sheet on a grid of 600 dots per inch, on which a column is its screen width times the ratio of the default font's widest digit at the two resolutions and a row its screen height times the ratio of the default row, so a printed sheet is not the size the screen shows. Positions are converted to twips once, when a page is written.

Conditional formats are drawn as EffectiveStyle(int, int, XlsxConditionalOptions?) gives them (Phase 202): fills, fonts, borders and colour scales; a data bar solid, where Excel's is a gradient.

Not drawn: charts, pictures and shapes on the sheet; icon sets and conditional formats given by a formula; pattern fills (their first colour is used); text turned to an angle (drawn level). A header or footer shows its text, the page number (&P), the page count (&N) and the sheet's name (&A).

The call is stateless and safe to make from several threads on different workbooks; it changes nothing in the workbook.

Methods

Layout(XlsxDocument, FontEngine, SpreadsheetLayoutOptions?)

Lays the sheets of a workbook out, one after another.

Layout(XlsxDocumentSheet, FontEngine, SpreadsheetLayoutOptions?)

Lays one sheet out.