TExportOptions Class
Options that affect how the grid is exported.
Syntax
Unit: UAdvGridExcelExport
TExportOptions = class(TPersistent);
Constructors
Name | Description |
---|---|
Create | Creates a new instance. |
Methods
Name | Description |
---|---|
Assign | Assigns the contents of Source to this object. |
Properties
Name | Description |
---|---|
CellSizes | If true, row heights and column widths will be exported to Excel. If false, columns and rows in Excel will have their default size. |
Formulas | If true, the formulas in the grid will be exported as formulas in Excel. If false, the result of the formula will be exported as a value in Excel. |
CellsAsStrings | When false (the default) cells will be exported as numbers, booleans, etc, to Excel, and you need to format them to look the same. When true, all cells in the grid will be exported as strings. This way, they will look exactly the same, but you will have a string "1" instead of a number 1 in the Excel cell. You can't use those strings in formulas. |
CellFormatting | When true, the cell format(background color, alignment, etc) will be exported to Excel. When false, the existing format in the Excel cells will be used. |
WordWrapped | When true (the default) word-wrapped cells in the grid will be exported as word-wrapped cells in Excel. When false, cells in Excel won't be word-wrapped. |
RawHTML | When false (the default), we will try to convert the html in the grid to similar formatitng in Excel. When true, html text in cells will be sent "as is" to Excel. |
RawRTF | If you set this property to true, RTF text in cells will be exported 'as is', without converting it to plain text. So, if you export a rich text "Hello" into cell A1 and this property is true, you will see a string similar to "{\rtf1\ansi\ansicpg1252\deff0\deflang14346{\fonttbl{\f0\fnil\fcharset0 Calibri;}}\viewkind4\uc1\pard\sa200\sl276\slmult1\lang10\f0\fs22H\b\i ello\b0\i0\par}" You can use this property when you don't want to show the spreadsheet to a final user, and just use it to save and load data into the grid. (AdvExcelIO will load those RTF strings back into rich text when you import the file) |
Images | If true (the default)the images in the grid will be exported to Excel. If false, no images will be exported. |
Comments | If true, comments in the grid will be exported to Excel. |
Checkboxes | If true (the default) checkboxes in the grid will be exported to checkboxes in Excel. |
HiddenColumns | IF true, hidden columns in the grid will be exported as hidden columns in Excel. If false, hidden columns won't be exported. |
HiddenRows | IF true, hidden rows in the grid will be exported as hidden rows in Excel. If false, hidden rows won't be exported. |
HardBorders | In Excel, a group of cells formatted in a solid background color won't show gridlines. If you set this property to true, we will add borders around those cells so they look like the grid. If false, gridlines will be the ones Excel shows, and won't show in solid color regions. |
ShowGridLines | If true, the exported Excel file willdisplay gridlines. If false, the exported Excel file will have a white background. If setting it to false, you might want to set HardBorders = true. |
CellMargins | AdvStringGrid by default has margins around the columns and rows. This means that for example a 20 pixel wide column might have 16 pixels of effective width. When this property is false, that column will be exported as 16 pixels to Excel. When true, the column width will be 20 pixels in Excel.<para/> IMPORTANT NOTE: YOU CAN SET THIS PROPERTY TO TRUE ONLY IF YOU ARE NOT REIMPORTING THE FILE. If you have an import/export cycle and this property is true, the column widths will grow ad infinitum. For example, imagine you export the column width at 20px. When importing, the column in advstringgrid will be 24 pixels, to fit all the text inside Excel. When you export this file again, it will be 24px, and when imported 28 and so on. <para/> In short, this property allows for a nicer export, but can only be used if you are not importing. |
ReadonlyCellsAsLocked | If true, readonly cells in the grid will be exported as Locked cells in Excel, and normal cells will be unlocked (so if you protect the sheet, those cells will not be editable in Excel). If false, all cells(readonly or not) will be exported as locked, the Excel default. |
PrintOptions | If true (the default), many print options in the grid like print orientation will be set also in the generated Excel file. If false, those options won't be exported. |
Outlines | If true (the default) nodes in the grid will be exported to outlines in Excel. You can control how the "+" symbols will appear with SummaryRowsBelowDetail |
SummaryRowsBelowDetail | If true, when exporting outlines to Excel the "+" symbols will be at the last row (or column) of the range. This is the Excel default, but it is not the way outlines show in AdvStringGrid. If false the "+" signs will appear at the start of the groups. |
UseExcelStandardColorPalette | When true, the standard Excel color palette will be used while exporting. Excel 97/2003 have only 53 available colors, and any color that does not match must be replaced with the nearest one. If this property is false, the Excel color palette will be changed to better display the real grid colors. Note that when you want to edit the generated file, having a custom palette might make it difficult to find the color you need. |
Hyperlinks | Determines how Hyperlinks in the grid will be exported to Excel. Excel is more limited than AdvStringGrid in that an hyperlink in Excel can only cover a full cell or not. |