C# Class Nettiers.AdventureWorks.Web.UI.GridViewExcelExporter

Exports a gridview to a excel file.
ファイルを表示 Open project: netTiers/netTiers Class Usage Examples

Public Methods

Method Description
Export ( string reportName, Page currentPage, Control gridView ) : void

Exports the datagrid to an Excel file with the name of the datasheet provided by the passed in parameter

GridViewExcelExporter ( ) : System

Ctor of the GridViewExcelExporter class

Protected Methods

Method Description
ClearChildControls ( System gridView ) : void

Clears the child controls of a EntityGridView to make sure all controls are LiteralControls

OnAfterFormat ( ExcelFormatEventArgs e ) : void

Called when a control is in the scope to be formated

OnBeforeFormat ( ExcelFormatEventArgs e ) : void

Called when a control is in the scope to be formated

Private Methods

Method Description
RecursiveClear ( Control control ) : void

Iterates a control and its children controls, ensuring they are all LiteralControls Only LiteralControl can call RenderControl(System.Web.UI.HTMLTextWriter htmlWriter) method. Otherwise a runtime error will occur. This is the reason why this method exists.

Method Details

ClearChildControls() protected method

Clears the child controls of a EntityGridView to make sure all controls are LiteralControls
protected ClearChildControls ( System gridView ) : void
gridView System Datagrid to be cleared and verified
return void

Export() public method

Exports the datagrid to an Excel file with the name of the datasheet provided by the passed in parameter
public Export ( string reportName, Page currentPage, Control gridView ) : void
reportName string
currentPage System.Web.UI.Page
gridView System.Web.UI.Control
return void

GridViewExcelExporter() public method

Ctor of the GridViewExcelExporter class
public GridViewExcelExporter ( ) : System
return System

OnAfterFormat() protected method

Called when a control is in the scope to be formated
protected OnAfterFormat ( ExcelFormatEventArgs e ) : void
e ExcelFormatEventArgs The ExcelFormatEventArgs instance containing the event data.
return void

OnBeforeFormat() protected method

Called when a control is in the scope to be formated
protected OnBeforeFormat ( ExcelFormatEventArgs e ) : void
e ExcelFormatEventArgs The ExcelFormatEventArgs instance containing the event data.
return void