TExportCell is the abstract cell class. Do not use it directly. Use child clases instead.
Name | Description |
---|---|
TExportCellEmpty | Empty cell |
TExportCellString | String cell |
TExportCellCustomNumber | Abstract number cell |
→ TExportCellNumber | Number cell |
→ TExportCellPercent | Percent cell |
→ TExportCellCurrency | Percent cell |
→ TExportCellDate | Date cell |
→ TExportCellDateTime | Datetime cell |
→ TExportCellDateTimeWS | Datetime (without seconds) cell |
→ TExportCellTime | Time cell |
→ TExportCellTimeWS | Time (without seconds) cell |
Name | Type | Description |
---|---|---|
Row | TExportRow | Row where the cell is placed. |
Col | TExportCol | Column where the cell is placed. |
RowIndex | Integer | Read-only index of the row (zero-based). |
ColIndex | Integer | Read-only index of the column (zero-based). |
RangeNoSpan | String | Excel range of the top-left corner of the cell. (E.g. "A1", "C15" etc.). |
RangeWithSpan | String | Excel range of the cell with column/row span. (E.g. "A1:B1", "C15:E15" etc.) If the cell has RowSpan = 1 and ColSpan = 1, this property is equal to RangeNoSpan. |
ColSpan | Integer | Column span |
RowSpan | Integer | Row span |
Name | OWideString | The defined name of the cell. The actual names are saved in the TOExport.NamedCells: TExportNamedCells object. |
Style | TExportCellStyle | Formatting style of the cell. |
Alignment | TCellHAlignment | Horizontal alignment |
VAlignment | TCellVAlignment | Vertical alignment |
Font | TExportFont | Font |
BGColor | TColor | Background color |
Borders | TExportCellBorders | Border |
Orientation | TExportFlowOrientation | Text orientation:
|
Rotation | TExportCellRotation | Text rotation in degrees. Value range: -90..90. Applicable only when Orientation is efoLeftToRight. |
WrapText | Boolean | Word wrap |
Width | Integer | Column width. This property reads/writes the Col.Width property of the appropriate worksheet column. |
Height | Integer | Row height. This property reads/writes the Row.Height property of the appropriate worksheet row. |
CalculateColWidth | Boolean | Set to true if the column width
should be calculated automatically form the cell text. Applicable only if WrapText = False, Orientation = efoLeftToRight, Rotation = 0 and ColSpan = 1. If more cells within a column have CalculateColWidth = True, the maximum width from the cells is calculated. Important: Column width and row height calculation works also for single-line cells with rich formatting. Multi-line cells with rich formatting are calculated like they were without formatting. |
Drawings | TExportCellDrawings | List with drawings in the cell (images / charts). Use DrawingsAssigned to check if Drawings exist in the cell. |
DrawingsAssigned | Boolean | Use DrawingsAssigned to check if Drawings exist in the cell. |
ConditionalFormatting | TExportConditionalFormatting | Conditional formatting Use ConditionalFormattingAssigned to check if ConditionalFormatting exists in the cell. |
ConditionalFormattingAssigned | Boolean | Use ConditionalFormattingAssigned to check if ConditionalFormatting exists in the cell. |
Comment | TExportCellComment | Comment Use CommentAssigned to check if Comment exists in the cell. |
ConditionalFormattingAssigned | Boolean | Use CommentAssigned to check if Comment exists in the cell. |
Formula | OWideString | The formula value. Note that you can use Excel/Calc functions in the formula that have to be in english language. If formula is set, you don't need to assign the result value - it will be automatically calculated by Excel or Calc. Please see Formula recalculation engine for more information about formulas in OExport. |
SqlText | OWideString | Cell value formatted as SQL text. For string cells, no formatting is used. Example: Datetime 2004-05-20 12:30:06, Float 158.123. For number cells with a formula, the result value is returned. |
FormattedText | OWideString | Cell value formatted as you can see it in Excel/Calc. Example: Datetime 24.01.2013 19:41:21, Float 15,1254, Currency $ 15.000,00 etc. |
function Set*(const *): TExportCell; |
---|
The Set* functions set the appropriate cell property and return Self (the cell object).
Thanks to this, more Set* functions can be called in one line. Example: //var xCell: TExportCell; xCell.SetFontName('Arial').SetFontSize(15).SetFontColor(clRed); |
function AddImage(const aFileName: OWideString; const aLeft, aTop, aWidth, aHeight: Integer): TExportCellDrawing; overload; |
Adds an image from a file into the cell. aFileName must be a valid file path with a valid
image extension (e.g. C:\flower.png). aLeft, aTop is the offset from upper-left border of the cell,
aWidth, aHeight are the dimensions of the image. Code snippets for adding images. |
function AddImage(const aStream: TStream; const aFileName: OWideString; const aLeft, aTop, aWidth, aHeight: Integer): TExportCellDrawing; overload; |
Adds an image from a stream into the cell. aFileName must be a valid file name with a valid
image extension (e.g. flower.png). Code snippets for adding images. |
function ReuseImage(const aDrawingIndex: Integer; const aLeft, aTop, aWidth, aHeight: Integer): TExportCellDrawing; |
Places an image that has already been added to a different cell with AddImage function.
Use aDrawingIndex to indicate the image. A chart can be placed only once in an document. Code snippets for adding images. |
function AddChart(const aChartType: TExportChartClass; const aLeft, aTop, aWidth, aHeight: Integer): TExportCellDrawing; |
Adds an empty chart into the cell. Please read the Chart classes section for more information. Code snippets for adding charts. |
function Transform(const aCellClass: TExportCellClass): TExportCell; |
Transforms the cell to desired type. All properties of the cell stay untouched.
OExport tries to re-assign the cell value.
The value is kept between all numeric cells (number, date, currency etc) but not
if you transform a string cell to a number etc. Important: the cell may be destroyed and a new cell may be created at it's place! |
function SetExcelNumberFormat(const aValue: OWideString; const aParse: Boolean): TExportCell; |
Assign a custom excel number format to a cell. If you specify aParse = true,
OExport tries to parse the format and use it for ODS/CSV export.
Important: Use english formatting strings!!! Examples of formatting strings:
|
function SetExcelNumberFormatAndTransform(const aValue: OWideString): TExportCell; |
This is a combination of SetExcelNumberFormat(aValue, True) and Transform. The new excel number format will be applied to the cell and the cell will be transformed to the desired type. |
procedure StyleAssignFromCol; |
Assign cell style from the column. |
procedure StyleAssignFromRow; |
Assign cell style from the row. |
procedure StyleAssignFromSheet; |
Assign cell style from the worksheet. |
procedure StyleClear; |
Clears the style (it calls Style.Clear). |