TreeViewSpreadExport
TreeViewSpreadExport is a powerful exporting API, allowing to export RadTreeView to XLSX, PDF, CSV, and TXT format, utilizing the Document Processing Libraries.
Definition
Namespace:Telerik.WinControls.Export
Assembly:Telerik.WinControls.UI.dll
Syntax:
public class TreeViewSpreadExport
Inheritance: objectTreeViewSpreadExport
Constructors
Initializes a new instance of the TreeViewSpreadExport class.
public TreeViewSpreadExport(RadTreeView radTreeView, SpreadExportFormat exportFormat)
The RadTreeView to export.
exportFormatSpreadExportFormatThe export format.
Initializes a new instance of the TreeViewSpreadExport class.
public TreeViewSpreadExport(RadTreeView radTreeView)
The RadTreeView to export.
Properties
Gets or sets a value indicating how children of collapsed nodes are exported.
public HiddenOption CollapsedNodeOption { get; set; }
Gets or sets a value indicating whether to export the check box values, when they are shown in tree nodes.
public bool ExportCheckBoxes { get; set; }
Gets or sets a value indicating whether to export child nodes grouped.
public bool ExportChildNodesGrouped { get; set; }
Gets or sets the format of the exported file - XLSX, PDF, CSV, TXT or XLS.
public SpreadExportFormat ExportFormat { get; set; }
The file extension.
Gets or sets a value indicating whether to export images.
public bool ExportImages { get; set; }
Gets or sets a value indicating whether the visual settings should be exported.
public bool ExportVisualSettings { get; set; }
true if visual settings are exported; otherwise, false.
Specifies how the file will be exported: as a new file, a new sheet in existing file or will override a sheet with given name.
public FileExportMode FileExportMode { get; set; }
NewSheetInExistingFile - will add a new sheet to the specified file, if it exists CreateOrOverrideFile - will create/override the specified file CreateOrOverrideSheet - will create/override the specified sheet
Gets or sets the indent of child nodes.
public int NodeIndent { get; set; }
Gets or sets the maximum number of rows per sheet.
[CLSCompliant(false)]
public ExcelMaxRows SheetMaxRows { get; set; }
The sheet max rows.
Methods
Cancels an asynchronous export operation.
public void CancelExportAsync()
Creates the worksheet cell range, writes content-cell values, and applies cell styling when requested.
protected virtual void CreateCell(TreeViewSpreadExportCell cell, int currentRowIndex, int currentColumnIndex)
The cell data to render.
currentRowIndexintThe worksheet row for the cell.
currentColumnIndexintThe first worksheet column occupied by the cell.
A cell spanning multiple columns is merged. Styling is written when ExportVisualSettings is enabled or CellFormatting has subscribers.
Places the cell's image over the specified worksheet cell when an image is present.
protected virtual void CreateImageOverCell(TreeViewSpreadExportImageCell cell, int currentRowIndex, int currentColumnIndex)
The export cell containing the image and its alignment.
currentRowIndexintThe worksheet row that anchors the image.
currentColumnIndexintThe worksheet column that anchors the image.
The built-in implementation uses ImageAlignment to calculate the vertical offset; the horizontal offset is always zero.
Copies text, fill, and border styling from a visual tree element into an export cell.
protected virtual void GetStylesFromVisualCell(TreeViewSpreadExportCell cell, LightVisualElement visualCell)
The export cell that receives the visual styling.
visualCellLightVisualElementThe visual element supplying the style; if null, the export cell is left unchanged.
The background color is resolved from the rendered fill, including an eligible ancestor fill when the element's own fill is not opaque.
Raises the event.
protected virtual void OnAsyncExportCompleted(AsyncCompletedEventArgs e)
The AsyncCompletedEventArgs instance containing the event data.
Raises the event.
protected virtual void OnAsyncExportProgressChanged(ProgressChangedEventArgs e)
The ProgressChangedEventArgs instance containing the event data.
Raises the event.
protected virtual void OnCellFormatting(TreeViewSpreadExportCellFormattingEventArgs e)
The TreeViewSpreadExportCellFormattingEventArgs instance containing the event data.
Starts an export operation, in the specified sheet. If such sheet does not exist, it gets created.
public void RunExport(Stream exportStream, ISpreadExportRenderer exportRenderer, string sheetName)
The stream where data will be exported.
exportRendererISpreadExportRendererInstance of ISpreadExportRenderer class.
sheetNamestringName of the sheet.
Starts an export operation.
public void RunExport(Stream exportStream, ISpreadExportRenderer exportRenderer)
The stream where data will be exported.
exportRendererISpreadExportRendererInstance of ISpreadExportRenderer class.
Starts an export operation, in the specified sheet. If such sheet does not exist, it gets created.
public void RunExport(string fileName, ISpreadExportRenderer exportRenderer, string sheetName)
The file name where data will be exported.
exportRendererISpreadExportRendererInstance of ISpreadExportRenderer class.
sheetNamestringName of the sheet.
Starts an export operation.
public void RunExport(string fileName, ISpreadExportRenderer exportRenderer)
The file name where data will be exported.
exportRendererISpreadExportRendererInstance of ISpreadExportRenderer class.
Starts an async export operation, in the specified sheet. If such sheet does not exist, it gets created. Note that if ExportVisualSettings is true, collecting the visual styles from the RadTreeView will still execute on the UI thread.
public void RunExportAsync(Stream exportStream, ISpreadExportRenderer exportRenderer, string sheetName)
The stream where data will be exported.
exportRendererISpreadExportRendererInstance of ISpreadExportRenderer class.
sheetNamestringName of the sheet.
Starts an export operation that runs in a background thread. Note that if ExportVisualSettings is true, collecting the visual styles from the RadTreeView will still execute on the UI thread.
public void RunExportAsync(Stream exportStream, ISpreadExportRenderer exportRenderer)
The stream where data will be exported.
exportRendererISpreadExportRendererInstance of ISpreadExportRenderer class.
Starts an async export operation, in the specified sheet. If such sheet does not exist, it gets created. Note that if ExportVisualSettings is true, collecting the visual styles from the RadTreeView will still execute on the UI thread.
public void RunExportAsync(string fileName, ISpreadExportRenderer exportRenderer, string sheetName)
The file name where data will be exported.
exportRendererISpreadExportRendererInstance of ISpreadExportRenderer class.
sheetNamestringName of the sheet.
Starts an export operation that runs in a background thread. Note that if ExportVisualSettings is true, collecting the visual styles from the RadTreeView will still execute on the UI thread.
public void RunExportAsync(string fileName, ISpreadExportRenderer exportRenderer)
The file name where data will be exported.
exportRendererISpreadExportRendererInstance of ISpreadExportRenderer class.
Events
Occurs when an async export operation is completed.
public event AsyncCompletedEventHandler AsyncExportCompleted
Occurs when the progress of an async export operation changes.
public event ProgressChangedEventHandler AsyncExportProgressChanged
Occurs for every cell that is being exported.
public event TreeViewSpreadExportCellFormattingEventHandler CellFormatting
Occurs when the export process completes.
public event EventHandler ExportCompleted