Class GridExcelConverterBase
GridExcelConverterBase is a base class for specific Grid to Excel Converter controls. Provides Support for Importing the Grid with data's from the spreadsheet.
Inheritance
Namespace: Syncfusion.GridExcelConverter
Assembly: Syncfusion.GridConverter.Windows.dll
Syntax
public class GridExcelConverterBase : Component
Constructors
GridExcelConverterBase()
Initializes a new instance of the GridExcelConverterBase class.
Declaration
public GridExcelConverterBase()
Fields
DEF_CHAR_CURRENCY
Currency format in the .Net.
Declaration
protected const char DEF_CHAR_CURRENCY = 'C'
Field Value
| Type |
|---|
| System.Char |
DEF_CHAR_DATE
Date format in the .Net.
Declaration
protected const char DEF_CHAR_DATE = 'D'
Field Value
| Type |
|---|
| System.Char |
DEF_CHAR_FIXEDPOINT
Fixed point format in the .Net.
Declaration
protected const char DEF_CHAR_FIXEDPOINT = 'F'
Field Value
| Type |
|---|
| System.Char |
DEF_CHAR_GENERAL
General format in the .Net.
Declaration
protected const char DEF_CHAR_GENERAL = 'G'
Field Value
| Type |
|---|
| System.Char |
DEF_CHAR_HEX
Hexadecimal format in the .Net.
Declaration
protected const char DEF_CHAR_HEX = 'X'
Field Value
| Type |
|---|
| System.Char |
DEF_CHAR_NUMBER
Number format in the .Net.
Declaration
protected const char DEF_CHAR_NUMBER = 'N'
Field Value
| Type |
|---|
| System.Char |
DEF_CHAR_PERCENT
Percent format in the .Net.
Declaration
protected const char DEF_CHAR_PERCENT = 'P'
Field Value
| Type |
|---|
| System.Char |
DEF_CHAR_SCIENTIFIC
Scientific format in the .Net.
Declaration
protected const char DEF_CHAR_SCIENTIFIC = 'E'
Field Value
| Type |
|---|
| System.Char |
DEF_DEFAULT_HALIGNMENT
Default horizontal alignment.
Declaration
protected const ExcelHAlign DEF_DEFAULT_HALIGNMENT = ExcelHAlign.HAlignLeft
Field Value
| Type |
|---|
| ExcelHAlign |
DEF_DEFAULT_VALIGNMENT
Default vertical alignment.
Declaration
protected const ExcelVAlign DEF_DEFAULT_VALIGNMENT = ExcelVAlign.VAlignTop
Field Value
| Type |
|---|
| ExcelVAlign |
DEF_EXCEL_CURRENCY_FORMAT
Currency format index in the MS Excel.
Declaration
protected const int DEF_EXCEL_CURRENCY_FORMAT = 7
Field Value
| Type |
|---|
| System.Int32 |
DEF_EXCEL_DATE_FORMAT
Date format index in the MS Excel.
Declaration
protected const int DEF_EXCEL_DATE_FORMAT = 14
Field Value
| Type |
|---|
| System.Int32 |
DEF_EXCEL_DECIMAL_FORMAT
Decimal format index in the MS Excel.
Declaration
protected const int DEF_EXCEL_DECIMAL_FORMAT = 4
Field Value
| Type |
|---|
| System.Int32 |
DEF_EXCEL_FIXEDPOINT_FORMAT
Fixed-point format index in the MS Excel.
Declaration
protected const int DEF_EXCEL_FIXEDPOINT_FORMAT = 4
Field Value
| Type |
|---|
| System.Int32 |
DEF_EXCEL_GENERAL_FORMAT
General format in Excel.
Declaration
protected const int DEF_EXCEL_GENERAL_FORMAT = 0
Field Value
| Type |
|---|
| System.Int32 |
DEF_EXCEL_HEX_FORMAT
Hex format index in the MS Excel.
Declaration
protected const int DEF_EXCEL_HEX_FORMAT = 0
Field Value
| Type |
|---|
| System.Int32 |
DEF_EXCEL_NUMBER_FORMAT
Number format index in the MS Excel.
Declaration
protected const int DEF_EXCEL_NUMBER_FORMAT = 4
Field Value
| Type |
|---|
| System.Int32 |
DEF_EXCEL_NUMBER_FORMATS
Gets the number format in Excel
Declaration
protected int[] DEF_EXCEL_NUMBER_FORMATS
Field Value
| Type |
|---|
| System.Int32[] |
DEF_EXCEL_PERCENT_FORMAT
Percent format index in the MS Excel.
Declaration
protected const int DEF_EXCEL_PERCENT_FORMAT = 9
Field Value
| Type |
|---|
| System.Int32 |
DEF_EXCEL_SCIENTIFIC_FORMAT
Scientific format index in the MS Excel.
Declaration
protected const int DEF_EXCEL_SCIENTIFIC_FORMAT = 11
Field Value
| Type |
|---|
| System.Int32 |
DEF_EXCEL2007_MAX_COLUMN_COUNT
Maximum one-based index of the column in MS Excel 2007.
Declaration
public const int DEF_EXCEL2007_MAX_COLUMN_COUNT = 16384
Field Value
| Type |
|---|
| System.Int32 |
DEF_EXCEL2007_MAX_ROW_COUNT
Maximum one-based index of the row in MS Excel 2007.
Declaration
public const int DEF_EXCEL2007_MAX_ROW_COUNT = 1048576
Field Value
| Type |
|---|
| System.Int32 |
DEF_GENERAL_FORMAT
General format.
Declaration
protected const string DEF_GENERAL_FORMAT = "GENERAL"
Field Value
| Type |
|---|
| System.String |
DEF_MAX_COLUMN_ONE_INDEX
Maximum one-based index of the column in MS Excel.
Declaration
public const int DEF_MAX_COLUMN_ONE_INDEX = 256
Field Value
| Type |
|---|
| System.Int32 |
DEF_MAX_COLUMN_ZERO_INDEX
Maximum zero-based index of the column in MS Excel.
Declaration
protected const int DEF_MAX_COLUMN_ZERO_INDEX = 255
Field Value
| Type |
|---|
| System.Int32 |
DEF_MAX_ROW_ONE_INDEX
Maximum one-based index of the row in MS Excel.
Declaration
public const int DEF_MAX_ROW_ONE_INDEX = 65536
Field Value
| Type |
|---|
| System.Int32 |
DEF_MAX_ROW_ZERO_INDEX
Maximum zero-based index of the row in MS Excel.
Declaration
public const int DEF_MAX_ROW_ZERO_INDEX = 65535
Field Value
| Type |
|---|
| System.Int32 |
DEF_MAXIMUM_ANGLE
Maximum possible angle value.
Declaration
protected const int DEF_MAXIMUM_ANGLE = 360
Field Value
| Type |
|---|
| System.Int32 |
DEF_MINIMUM_SUPPORTED_ANGLE
Angle that corresponds to 90 rotation value in the XlsIO.
Declaration
protected const int DEF_MINIMUM_SUPPORTED_ANGLE = 270
Field Value
| Type |
|---|
| System.Int32 |
DEF_NUMBER_FORMAT
Default number format in Grid cell
Declaration
protected const string DEF_NUMBER_FORMAT = "0"
Field Value
| Type |
|---|
| System.String |
DEF_RIGHT_ANGLE
Right angle value.
Declaration
protected const int DEF_RIGHT_ANGLE = 90
Field Value
| Type |
|---|
| System.Int32 |
hasForeColor
variable setting whether header has fore color
Declaration
protected bool hasForeColor
Field Value
| Type |
|---|
| System.Boolean |
hasHeaderBKColor
variable setting whether header has back color
Declaration
protected bool hasHeaderBKColor
Field Value
| Type |
|---|
| System.Boolean |
PatternStyleToExcelPattern
PatternStyle - to - ExcelPattern HashTable.
Declaration
protected static readonly Hashtable PatternStyleToExcelPattern
Field Value
| Type |
|---|
| System.Collections.Hashtable |
Properties
ExportBorders
Gets or sets a value indicating whether the cell borders should be exported.
Declaration
public virtual bool ExportBorders { get; set; }
Property Value
| Type |
|---|
| System.Boolean |
ExportImage
Gets or sets a value indicating whether export the images into excel.
Declaration
public bool ExportImage { get; set; }
Property Value
| Type |
|---|
| System.Boolean |
Remarks
Effective only when ExportStyle is true.
ExportStyle
Gets or sets a value indicating whether the styles should get exported. The default value is true.
Declaration
public virtual bool ExportStyle { get; set; }
Property Value
| Type |
|---|
| System.Boolean |
Remarks
With version 5.1 the GridExcelConverter has been enhanced. Since it export all style properties, the time taken to export a huge grid will be more relative to below versions GridConverter. If you dont want to export styles this can be set to false.
Grid
Gets or sets the GridModel.
Declaration
protected GridModel Grid { get; set; }
Property Value
| Type |
|---|
| GridModel |
HeaderBackColor
Gets or sets the exported header cell's back color in worksheet.
Declaration
public Color HeaderBackColor { get; set; }
Property Value
| Type |
|---|
| System.Drawing.Color |
IsGroupingGrid
Gets a value indicating whether the grid is a GroupingGrid.
Declaration
protected virtual bool IsGroupingGrid { get; }
Property Value
| Type |
|---|
| System.Boolean |
UseDefaultAlignment
Gets a value indicating whether default alignment setting should be used when alignment wasn't set. Read-only.
Declaration
public virtual bool UseDefaultAlignment { get; }
Property Value
| Type |
|---|
| System.Boolean |
Methods
CombineStyles(GridStyleInfo, GridStyleInfo)
Determines whether styles should be combined for specified cell styles and combines cell's interior, alignment, borders, font, cell type, format to destination cell.
Declaration
protected bool CombineStyles(GridStyleInfo destinationStyle, GridStyleInfo baseStyle)
Parameters
| Type | Name | Description |
|---|---|---|
| GridStyleInfo | destinationStyle | Style which is primary and in which result will be accumulated. |
| GridStyleInfo | baseStyle | Style to combine. |
Returns
| Type | Description |
|---|---|
| System.Boolean | Value indicating that not all properties were set. |
Exceptions
| Type | Condition |
|---|---|
| System.ArgumentNullException | If |
CreateEngine()
Creates excel engine.
Declaration
protected ExcelEngine CreateEngine()
Returns
| Type | Description |
|---|---|
| ExcelEngine | Newly created ExcelEngine. |
Remarks
The caller of this method is responsible for calling Dispose on the created ExcelEngine after all workbooks have been closed and the caller is finished with the engine.
ExportAlignmentToExcel(GridStyleInfo, IRange)
Exports alignment settings from grid cell into excel cell.
Declaration
protected virtual void ExportAlignmentToExcel(GridStyleInfo gridCell, IRange range)
Parameters
| Type | Name | Description |
|---|---|---|
| GridStyleInfo | gridCell | The style of the grid cell. |
| IRange | range | The destination IRange. |
ExportBordersToExcel(GridBorder, IBorder)
Exports border settings from grid border into excel border.
Declaration
protected virtual void ExportBordersToExcel(GridBorder cellBorder, IBorder rangeBorder)
Parameters
| Type | Name | Description |
|---|---|---|
| GridBorder | cellBorder | The style of the grid cell. |
| IBorder | rangeBorder | The destination IBorder. |
Exceptions
| Type | Condition |
|---|---|
| System.ArgumentNullException | If |
ExportBordersToExcel(GridStyleInfo, IRange)
Exports borders settings from grid cell into excel cell.
Declaration
protected virtual void ExportBordersToExcel(GridStyleInfo gridCell, IRange range)
Parameters
| Type | Name | Description |
|---|---|---|
| GridStyleInfo | gridCell | The style of the grid cell. |
| IRange | range | The destination IRange. |
Exceptions
| Type | Condition |
|---|---|
| System.ArgumentNullException | If |
ExportBrushToExcel(GridStyleInfo, IRange)
Exports brush settings from grid cell into excel cell.
Declaration
protected virtual void ExportBrushToExcel(GridStyleInfo gridCell, IRange range)
Parameters
| Type | Name | Description |
|---|---|---|
| GridStyleInfo | gridCell | The style of the grid cell. |
| IRange | range | The destination IRange. |
ExportFontToExcel(GridStyleInfo, IRange)
Exports the font settings from grid cell into excel cell.
Declaration
protected virtual void ExportFontToExcel(GridStyleInfo gridCell, IRange range)
Parameters
| Type | Name | Description |
|---|---|---|
| GridStyleInfo | gridCell | The style of the grid cell. |
| IRange | range | The destination IRange. |
ExportImageToExcel(GridStyleInfo, IRange)
Exports the image from the grid cell to excel cell range.
Declaration
protected virtual void ExportImageToExcel(GridStyleInfo gridCell, IRange range)
Parameters
| Type | Name | Description |
|---|---|---|
| GridStyleInfo | gridCell | The grid cell. |
| IRange | range | The destination IRange. |
ExportImageToExcel(Image, IRange)
Exports the image from the grid cell to excel cell range.
Declaration
protected virtual void ExportImageToExcel(Image image, IRange range)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Drawing.Image | image | The System.Drawing.Image to export. |
| IRange | range | The destination IRange. |
ExportNumberFormatToExcel(GridStyleInfo, IRange)
Exports the number format index for a range from specified grid style.
Declaration
protected virtual void ExportNumberFormatToExcel(GridStyleInfo gridStyle, IRange range)
Parameters
| Type | Name | Description |
|---|---|---|
| GridStyleInfo | gridStyle | The style of the grid cell. |
| IRange | range | The destination IRange. |
ExportStylesToExcel(GridModel, Int32, Int32, GridStyleInfo, IRange)
Exports the style of grid cell into excel cell.
Declaration
protected virtual void ExportStylesToExcel(GridModel grid, int iRow, int iColumn, GridStyleInfo gridCell, IRange range)
Parameters
| Type | Name | Description |
|---|---|---|
| GridModel | grid | The GridModel. |
| System.Int32 | iRow | The row index of the grid. |
| System.Int32 | iColumn | The column index of the grid. |
| GridStyleInfo | gridCell | The style of the grid cell. |
| IRange | range | The destination IRange. |
ExportStylesToExcel(GridModel, Int32, Int32, IRange)
Exports the styles to Excel.
Declaration
protected virtual void ExportStylesToExcel(GridModel grid, int iRow, int iColumn, IRange range)
Parameters
| Type | Name | Description |
|---|---|---|
| GridModel | grid | The GridModel. |
| System.Int32 | iRow | The row index of the grid. |
| System.Int32 | iColumn | The column index of the grid. |
| IRange | range | The destination IRange. |
ExportStylesToExcel(GridStyleInfo, IRange)
Exports the style from grid style into range style.
Declaration
protected virtual void ExportStylesToExcel(GridStyleInfo gridStyle, IRange destRange)
Parameters
| Type | Name | Description |
|---|---|---|
| GridStyleInfo | gridStyle | The style of the grid cell. |
| IRange | destRange | The destination IRange. |
Exceptions
| Type | Condition |
|---|---|
| System.ArgumentNullException | If |
RaiseQueryImportExportCellInfo(GridImportExportCellInfoEventArgs)
Initiates call to Syncfusion.GridExcelConverter.GridExcelConverterBase.OnQueryImportExportCellInfo(Syncfusion.GridExcelConverter.GridImportExportCellInfoEventArgs).
Declaration
protected void RaiseQueryImportExportCellInfo(GridImportExportCellInfoEventArgs e)
Parameters
| Type | Name | Description |
|---|---|---|
| GridImportExportCellInfoEventArgs | e | The event arguments. |
Events
QueryImportExportCellInfo
Occurs for each cell before the GridExcelConverterControl imports/ exports and let users customize the cell info.
Declaration
public event GridImportExportCellInfoEventHandler QueryImportExportCellInfo
Event Type
| Type |
|---|
| GridImportExportCellInfoEventHandler |