New to Telerik UI for WinForms? Start a free 30-day trial

Defines the workbook, worksheet, cell, and formatting operations used by spreadsheet export.

Definition

Namespace:Telerik.WinControls

Assembly:Telerik.WinControls.dll

Syntax:

C#
public interface ISpreadExportRenderer

Methods

Adds a hyperlink to the current cell selection.

C#
void AddHyperlink(string link)
Parameters:linkstring

The hyperlink target.

Adds a worksheet with the specified name. If the name is blank, the renderer uses its default name; if the name already exists, the renderer may add a suffix to make it unique.

C#
void AddWorksheet(string sheetName)
Parameters:sheetNamestring

The worksheet name.

Notifies the renderer that workbook construction is complete.

C#
void CallWorkbookCreated()

Clears the value in the current cell selection.

C#
void ClearCellSelectionValue()

Selects a rectangular worksheet cell range for subsequent operations.

C#
void CreateCellSelection(int fromRowIndex, int fromColumnIndex, int toRowIndex, int toColumnIndex)
Parameters:fromRowIndexint

The starting row index.

fromColumnIndexint

The starting column index.

toRowIndexint

The ending row index.

toColumnIndexint

The ending column index.

Selects a single worksheet cell for subsequent value and formatting operations.

C#
void CreateCellSelection(int rowIndex, int columnIndex)
Parameters:rowIndexint

The row index of the cell.

columnIndexint

The column index of the cell.

Creates style information for the current cell selection.

C#
void CreateCellStyleInfo()

Creates style information for the current cell selection from explicit visual attributes.

C#
void CreateCellStyleInfo(Color backColor, Color foreColor, FontFamily fontFamily, double fontSize, bool isBold, bool isItalic, bool underline, ContentAlignment textAlignment, bool textWrap, BorderBoxStyle borderBoxStyle, Color borderColor, Color borderTopColor, Color borderBottomColor, Color borderRightColor, Color borderLeftColor, Orientation textOrientation = Orientation.Horizontal)
Parameters:backColorColor

The cell fill color.

foreColorColor

The text color.

fontFamilyFontFamily

The font family.

fontSizedouble

The font size.

isBoldbool

true to use bold text.

isItalicbool

true to use italic text.

underlinebool

true to underline the text.

textAlignmentContentAlignment

The cell's text alignment.

textWrapbool

true to wrap text in the cell.

borderBoxStyleBorderBoxStyle

The cell border-box style.

borderColorColor

The general border color.

borderTopColorColor

The top border color.

borderBottomColorColor

The bottom border color.

borderRightColorColor

The right border color.

borderLeftColorColor

The left border color.

textOrientationOrientation

The orientation of the cell text.

Creates an image positioned relative to a worksheet cell.

C#
void CreateFloatingImage(int rowIndex, int columnIndex, int offsetX, int offsetY, byte[] bytes, string extension, int width, int height, int rotationAngle)
Parameters:rowIndexint

The row containing the image anchor.

columnIndexint

The column containing the image anchor.

offsetXint

The horizontal offset from the cell anchor.

offsetYint

The vertical offset from the cell anchor.

bytesbyte[]

The image data.

extensionstring

The image file extension.

widthint

The image width.

heightint

The image height.

rotationAngleint

The image rotation angle.

Freezes the specified number of leading rows and columns in the worksheet.

C#
void CreateFreezePanes(int rowsCount, int columnsCount)
Parameters:rowsCountint

The number of leading rows to freeze.

columnsCountint

The number of leading columns to freeze.

Creates non-group row metadata at a specified hierarchy level.

C#
IGridViewSpreadExportRowInfo CreateGridViewExportDataRowInfo(int currentIndent, List<IGridViewSpreadExportCellInfo> cells, bool exportAsHidden, int hierarchyLevel)
Parameters:currentIndentint

The number of leading cells used to represent the row's hierarchy indentation.

cellsList<IGridViewSpreadExportCellInfo>

The cell data for the row.

exportAsHiddenbool

true to mark the exported row as hidden.

hierarchyLevelint

The row's hierarchy level.

Returns:

IGridViewSpreadExportRowInfo

The row metadata used by the renderer to write the data row.

Creates row metadata for a non-group row, such as a data, header, or summary row.

C#
IGridViewSpreadExportRowInfo CreateGridViewExportDataRowInfo(int currentIndent, List<IGridViewSpreadExportCellInfo> cells, bool exportAsHidden)
Parameters:currentIndentint

The number of leading cells used to represent the row's hierarchy indentation.

cellsList<IGridViewSpreadExportCellInfo>

The cell data for the row.

exportAsHiddenbool

true to mark the exported row as hidden.

Returns:

IGridViewSpreadExportRowInfo

The row metadata used by the renderer to write the data row.

Creates group-row metadata at a specified hierarchy level.

C#
IGridViewSpreadExportRowInfo CreateGridViewExportGroupRowInfo(int currentIndent, string content, int colSpan, bool exportAsHidden, int hierarchyLevel)
Parameters:currentIndentint

The number of leading cells used to represent the group's hierarchy indentation.

contentstring

The text displayed in the group row.

colSpanint

The offset from the starting column to the inclusive last column; the merged range spans this offset plus one column.

exportAsHiddenbool

true to mark the exported row as hidden.

hierarchyLevelint

The group's hierarchy level.

Returns:

IGridViewSpreadExportRowInfo

The row metadata used by the renderer to write the group row.

Creates row metadata for a group row containing the specified text.

C#
IGridViewSpreadExportRowInfo CreateGridViewExportGroupRowInfo(int currentIndent, string content, int colSpan, bool exportAsHidden)
Parameters:currentIndentint

The number of leading cells used to represent the group's hierarchy indentation.

contentstring

The text displayed in the group row.

colSpanint

The offset from the starting column to the inclusive last column; the merged range spans this offset plus one column.

exportAsHiddenbool

true to mark the exported row as hidden.

Returns:

IGridViewSpreadExportRowInfo

The row metadata used by the renderer to write the group row.

Initializes a new workbook for export.

C#
void CreateWorkbook()

Writes the current workbook to the specified stream.

C#
void Export(Stream stream)
Parameters:streamStream

The destination stream.

Gets the renderer-specific object for the current cell selection.

C#
object GetCellSelection()
Returns:

object

Gets the value in the current cell selection.

C#
object GetCellSelectionValue()
Returns:

object

The selected cell value.

Gets the style attributes for the current cell selection.

C#
ISpreadExportCellStyleInfo GetCellStyleInfo()
Returns:

ISpreadExportCellStyleInfo

Gets the filename extension associated with an export format.

C#
object GetFileExtension(SpreadExportFormat exportFormat)
Parameters:exportFormatSpreadExportFormat

The export format.

Returns:

object

The extension associated with exportFormat.

Selects the registered format provider for subsequent workbook operations.

C#
void GetFormatProvider(SpreadExportFormat exportFormat)
Parameters:exportFormatSpreadExportFormat

The format whose provider to select.

Determines whether the worksheet cell at the specified coordinates is merged.

C#
bool GetIsMerged(int rowIndex, int columnIndex)
Parameters:rowIndexint

The row index to check.

columnIndexint

The column index to check.

Returns:

bool

true if the cell is merged; otherwise, false.

Gets the renderer-specific object for the current worksheet.

C#
object GetWorksheet()
Returns:

object

Gets the width of a worksheet column.

C#
int GetWorksheetColumnWidth(int columnIndex)
Parameters:columnIndexint

The column index.

Returns:

int

The column width.

Gets the height of a worksheet row.

C#
double GetWorksheetRowHeight(int rowIndex)
Parameters:rowIndexint

The row index.

Returns:

double

The row height.

Groups the worksheet rows in the specified range at the given outline level.

C#
void GroupRows(int startRow, int endRow, int level)
Parameters:startRowint

The first row in the group.

endRowint

The last row in the group.

levelint

The outline level assigned to the group.

Loads an existing workbook from the specified stream.

C#
void ImportWorkbook(Stream stream)
Parameters:streamStream

The stream containing the workbook.

Merges the cells in the current selection.

C#
void MergeCellSelection()

Registers the format provider required for the specified export format.

C#
void RegisterFormatProvider(SpreadExportFormat exportFormat)
Parameters:exportFormatSpreadExportFormat

The format whose provider to register.

Replaces the worksheet identified by the specified name, or adds a worksheet when no matching sheet exists.

C#
bool ReplaceWorksheet(string sheetName)
Parameters:sheetNamestring

The name of the worksheet to replace.

Returns:

bool

true if an existing worksheet was replaced; otherwise, false.

Sets the format string for the current cell selection.

C#
void SetCellSelectionFormat(string formatString)
Parameters:formatStringstring

The format string to apply.

Sets the selected cell value with an explicit data type.

C#
void SetCellSelectionValue(DataType dataType, object value)
Parameters:dataTypeDataType

The type used to interpret the value.

valueobject

The value to write.

Sets the selected cell value from text.

C#
void SetCellSelectionValue(string text)
Parameters:textstring

The text to write.

Sets the width of a worksheet column.

C#
void SetWorksheetColumnWidth(int columnIndex, double value, bool isCustom)
Parameters:columnIndexint

The column index.

valuedouble

The column width.

isCustombool

Whether the column width is a custom value.

Sets the height of a worksheet row.

C#
void SetWorksheetRowHeight(int rowIndex, int rowHeight, bool isCustom)
Parameters:rowIndexint

The row index.

rowHeightint

The row height.

isCustombool

Whether the row height is a custom value.