Spread Windows Forms 8.0 Product Documentation > Import and Export Reference > Excel-Formatted Files Export > Cell-Type Settings Exported |
Spread provides built-in cell types to allow cell formatting whereas Excel provides cell formats. Excel supports cell-level data formatting by allowing format strings to be applied to cells. There is not a simple one-to-one correspondence between Spread cell types and Excel cell formats. When Spread exports cells to an Excel‑formatted file, Spread builds an Excel-like format string based on the cell type properties. That format string is then compared to Excel’s internal number formats. If there is a match, the format is exported as an index into Excel’s internal number format table. If, however, there is not a match, the format string is exported as a custom format.
For cell types that you create, any formatting is lost upon exporting. Since Spread cannot know what cell format corresponds to a custom cell type, only the value is exported.
For more information on cell types, refer to Customizing Interaction with Cell Types in the Developer's Guide.
The table below summarizes the formats that are exported when Spread exports to an Excel‑formatted file and the restrictions that apply. There is a considerable amount of functionality in Spread that does not have an equivalent in Excel and so is lost on export. The cell types are each in a separate class in the FarPoint.Win.Spread.CellType namespace.
Spread Cell Type | Excel Format | Remarks and Restrictions |
---|---|---|
General or Custom format |
Spread does not export barcode images to Excel objects. |
|
General or Custom format |
The cell contains the value from the button. Spread does not export to Excel objects. |
|
General or Custom format |
The cell contains True or False. The check box control has no equivalent in Excel. |
|
General or Custom format |
Spread does not export this color or color picker images to Excel objects. |
|
General or Custom format |
The cell contains the value of the selected or default item from the combo box or index of that item and the list. Spread does not export to Excel objects. |
|
Currency format |
The cell contains the numeric value with the currency format. |
|
Date or Time or Custom format |
The cell contains the date and time value and format. |
|
General format |
The cell is empty. |
|
General or custom format |
If the ExcelExportFormat property is null, the format is General. If the ExcelExportFormat property is not null, the format is custom. |
|
General or custom format |
The cell contains the text. |
|
General format |
The Spread GeneralCellType parses and formats similarly to Excel, with the difference being that the Spread GeneralCellType parses the input data to determine the best-fit data type and format string for the data. When saved to Excel, the parsed format string is saved as well. For example, if you have a number in a GeneralCellType, it is exported with a custom format. |
|
General or Custom format |
The cell contains the string of text without a hyperlink. |
|
General or default |
Images are exported as shapes (BIFF8 only). |
|
General or Custom format |
The cell contains the string value. |
|
General or Custom format |
The cell contains the value of the selected or default item from the multiple options button. (See further explanation below.) Spread does not export to Excel objects. |
|
Integer or Custom format |
The cell contains the numeric value with formatting. |
|
Percentage or Custom format |
The cell contains the actual value (not the percent value) with formatting. For example, if the minimum was 0 and maximum was 200, and the value was 50, the value of 50 would be exported, not 25%. |
|
Percentage or Custom format |
The cell contains the percent value. Spread does not export to Excel objects. |
|
General or default |
The cell contains the value. |
|
General or default |
Spread does not export rich text formatted data to a cell format in Excel. |
|
General or Custom format |
The cell contains the numeric value. Spread does not export to Excel objects. |
|
General or Custom format |
The cell contains the text. |
For a combo box cell type, by default, the value in the data model which is exported is the string of the selected item in the combo box. If you set the EditorValue property of the ComboBoxCellType to Index, then the index of the selected item is stored in the data model, and thus written out to Excel in the export. You would set the EditorValue to String if you wanted the string value. For more information, refer to the ComboBoxCellType in the Assembly Reference.
For a multiple option cell type, by default, the value in the data model which is exported is the string of the selected option. If you set the EditorValue property of the MultiOptionCellType to Index, then the index of the selected item is stored in the data model, and thus written out to Excel in the export. You would set the EditorValue to String if you wanted the string value. For more information, refer to the MultiOptionCellType in the Assembly Reference.