Table of Contents

Class SpreadsheetGeometry

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

Where the columns and rows of a sheet are on the screen at 100 per cent: what a grid view draws from, without paginating anything.

public sealed class SpreadsheetGeometry
Inheritance
SpreadsheetGeometry
Inherited Members

Remarks

Positions are in twips from the top-left corner of cell A1 and are whole screen pixels of 15 twips (three quarters of a point), which is how Excel sizes a sheet: a column is a number of the workbook's default font's widest digit in pixels plus padding, a row is its height in points rounded to pixels. For the default font of every workbook Excel makes (Aptos Narrow 11, and Calibri 11 before it) a default column is 64 pixels and a default row 20.

A hidden column or row has no width or height and the one after it starts where it does. A row the file gives no height is as tall as the tallest font in its cells.

Frozen panes are reported, not applied: FrozenWidth and FrozenHeight say how much of the view the frozen columns and rows take, and a view scrolls the rest under them.

A twip count is a 32-bit number: about 143 million screen pixels. A sheet of more than a million rows that are each made very tall goes past that, and a position in twips stops at the largest number. The members that answer in pixels (GetRowTopPixels(int), GetColumnLeftPixels(int), GetRowAtPixel(long), GetColumnAtPixel(long)) are exact for the whole grid.

The geometry is read when it is made and does not follow later edits of the sheet; make another.

Fields

MaxColumn

The last column of a sheet.

MaxRow

The last row of a sheet.

Properties

DefaultColumnWidth

Gets the width of a column nothing gives a width.

DefaultRowHeight

Gets the height of a row nothing gives a height; zero when the sheet hides such rows.

FrozenColumns

Gets the number of columns frozen at the left of the sheet.

FrozenHeight

Gets the height the frozen rows take at the top of a view.

FrozenRows

Gets the number of rows frozen at the top of the sheet.

FrozenWidth

Gets the width the frozen columns take at the left of a view.

MaxDigitWidthPixels

Gets the width, in screen pixels, of the widest digit of the workbook's default font: the unit a column's width is counted in.

Methods

For(XlsxDocumentSheet, FontEngine, IConversionDiagnostics?)

Reads the geometry of a sheet.

GetColumnAt(Twips)

Gets the column a horizontal position falls in.

GetColumnAtPixel(long)

Gets the column a horizontal position in screen pixels falls in.

GetColumnLeft(int)

Gets the distance of a column's left edge from the left edge of column A.

GetColumnLeftPixels(int)

Gets the distance of a column's left edge from the left edge of column A, in screen pixels.

GetColumnWidth(int)

Gets the width of a column; zero for a hidden column.

GetRowAt(Twips)

Gets the row a vertical position falls in.

GetRowAtPixel(long)

Gets the row a vertical position in screen pixels falls in.

GetRowHeight(int)

Gets the height of a row; zero for a hidden row.

GetRowTop(int)

Gets the distance of a row's top edge from the top edge of row 1.

GetRowTopPixels(int)

Gets the distance of a row's top edge from the top edge of row 1, in screen pixels.