Table of Contents

SpreadsheetInputOptions Class

Definition

Namespace
GleamTech.DocumentUltimate
Assembly
GleamTech.DocumentUltimate.dll

Represents a set of Spreadsheet input options used for document conversion.

public class SpreadsheetInputOptions : InputOptions
Inheritance
SpreadsheetInputOptions

Examples

Choosing only the visible sheets for output and preventing breaking of columns:

var inputOptions = new SpreadsheetInputOptions
{
    //Choose only visible sheets (not hidden data sheets)
    //This is also the default value DocumentViewer uses internally
    OutputSheetRange = new SheetRange("visible"),

    //All columns of a rendered sheet should fit to the same page (do not break)
    //This is also the default value DocumentViewer uses internally
    RenderColumnsFitToPages = 1
};

DocumentConverter.Convert(@"c:\SomeFolder\InputFile.xlsx", inputOptions, DocumentFormat.Pdf);
'Choose only visible sheets (not hidden data sheets)
'This is also the default value DocumentViewer uses internally

'All columns of a rendered sheet should fit to the same page (do not break)
'This is also the default value DocumentViewer uses internally
Dim inputOptions As New SpreadsheetInputOptions() With {
    .OutputSheetRange = New SheetRange("visible"),
    .RenderColumnsFitToPages = 1
}

DocumentConverter.Convert("c:\SomeFolder\InputFile.xlsx", inputOptions, DocumentFormat.Pdf)

Choosing only the active sheet for output and fitting all rows in a predefined page count:

var inputOptions = new SpreadsheetInputOptions
{
    //Choose only the active sheet
    OutputSheetRange = new SheetRange("active"),

    //All rows of a rendered sheet should fit to 2 pages
    RenderRowsFitToPages = 2
};

DocumentConverter.Convert(@"c:\SomeFolder\InputFile.xlsx", inputOptions, DocumentFormat.Pdf);
'Choose only the active sheet

'All rows of a rendered sheet should fit to 2 pages
Dim inputOptions As New SpreadsheetInputOptions() With {
    .OutputSheetRange = New SheetRange("active"),
    .RenderRowsFitToPages = 2
}

DocumentConverter.Convert("c:\SomeFolder\InputFile.xlsx", inputOptions, DocumentFormat.Pdf)

Choosing specific sheets for output:

var inputOptions = new SpreadsheetInputOptions
{
    //Choose only the sheet 1, 2 and 3
    OutputSheetRange = new SheetRange("1-3"),
};

DocumentConverter.Convert(@"c:\SomeFolder\InputFile.xlsx", inputOptions, DocumentFormat.Pdf);
'Choose only the sheet 1, 2 and 3
Dim inputOptions As New SpreadsheetInputOptions() With {
    .OutputSheetRange = New SheetRange("1-3")
}

DocumentConverter.Convert("c:\SomeFolder\InputFile.xlsx", inputOptions, DocumentFormat.Pdf)

Constructors

SpreadsheetInputOptions()

Initializes a new instance of the SpreadsheetInputOptions class.

SpreadsheetInputOptions(DocumentFormat)

Initializes a new instance of the SpreadsheetInputOptions class with a document format.

Properties

OutputSheetRange

Gets or sets the range of sheet numbers to output. Default is "all". A string representation of number ranges (e.g. 1-5, 8, 11-13) or keywords (all, even, odd, visible, active) can be directly assigned to this property.

RenderArea

Gets or sets the range to be rendered. For example "A1:K15" specifies a range of A to K columns and 1 to 15 rows.

RenderBlackAndWhite

Gets or sets a value that specifies whether the document will be rendered in black and white. The default is false.

RenderCenterFooter

Gets or sets the center footer to be rendered. See remarks in docs for possible script and format codes.

RenderCenterHeader

Gets or sets the center header to be rendered. See remarks in docs for possible script and format codes.

RenderCenterHorizontally

Gets or sets a value that specifies whether the sheet is centered horizontally when rendered. The default is false.

RenderCenterVertically

Gets or sets a value that specifies whether the sheet is centered vertically when rendered. The default is false.

RenderColumnsFitToPages

Gets or sets the number of pages the columns should fit when it's rendered. The default is 0 which means columns could be broken into multiple pages if required. For example if you set the value 1, all columns would be rendered on a single page.

RenderGridlines

Gets or sets a value that specifies whether cell gridlines are rendered on pages. The default is false.

RenderHeadings

Gets or sets a value that specifies whether column (e.g. A, B) and row (e.g. 1, 2) headings are rendered on pages. The default is false.

RenderLeftFooter

Gets or sets the left footer to be rendered. See remarks in docs for possible script and format codes.

RenderLeftHeader

Gets or sets the left header to be rendered. See remarks in docs for possible script and format codes.

RenderRightFooter

Gets or sets the right footer to be rendered. See remarks in docs for possible script and format codes.

RenderRightHeader

Gets or sets the right header to be rendered. See remarks in docs for possible script and format codes.

RenderRowsFitToPages

Gets or sets the number of pages the rows should fit when it's rendered. The default is 0 which means rows could be broken into multiple pages if required. For example if you set the value 1, all rows would be rendered on a single page.

RenderTitleColumns

Gets or sets the columns that contain the cells to be repeated on the left side of each page. For example "$A:$A" specifies first column only and "$A:$C" specifies first, second and third columns.

RenderTitleRows

Gets or sets the rows that contain the cells to be repeated at the top of each page. For example "$1:$1" specifies first row only and "$1:$3" specifies first, second and third rows.