UserExportCell
When exporting to Excel, specify additional content to be output in addition to the content output by the grid.
Signature:
export interface UserExportCell
Remarks
Be careful because errors may occur in the Excel file if you overwrite the area where the grid is output. row, col, and value must be specified.
Example
var userCells = [
{row: 0, col: 0, value: "User input string"},
{row: 1, col: 0, styleName: "userCellRed", value: "Apply style"},
{row: 2, col: 0, mergeRow: 1, mergeCol: 3, styleName: "userCellRed", value: "Merge and apply style."},
{row: 3, col: 0, value: "inline-style", styles: {background:"red", fontSize:"20px"}},
{row: 4, col: 0, value: 12345, format: "#,##0.0_ ", styles: {textAlign:"right"}},
{row: 4, col: 2, value: new Date(2022, 4, 16), format: "[$-F800]dddd, mmmm dd, yyyy", styles: {textAlign:"center"}},
]
gridView.exportGrid({"type": "excel", "target": "local", "yOffset": 5, "userCells": userCells});
Properties
Property | Type | Description |
---|---|---|
CellMemo | CellMemo | String | Outputs a memo to a cell. |
cellProtectProps | CellProtectProperties | |
col | number | Calculated starting from the column number to be output, 0 . |
format | string | Enter the format to be applied to the cell. |
height | number | Specifies the height of the row. |
heights | number[] | If mergeRow exists, specify the height of each row. |
image | UserCellImage | string | Add an image to a cell. Images cannot be displayed larger than their cells (including merged ones). |
mergeCol | number | Number of columns when merging |
mergeRow | number | Number of rows when merging |
row | number | It is calculated from the line number to be output: 0 . |
styleName | string | className to be applied to the cell |
styles | ConfigObject | string | Style to be applied to cell |
value | any | What will be printed |
width | number | Specifies the width of the column. |
widths | number[] | Specifies the width of each column if mergeCol is present. |
Properties Desc
cellMemo
Prints a memo in a cell.
Type
- CellMemo | string
Remarks:
You can set a message by entering it as a string.
cellProtectProps
Type
- CellProtectProperties
Remarks:
lock
col
Calculated starting from the column number to be output, 0
.
Type
- number
format
Enter the format to be applied to the cell.
Type
- string
height
Specifies the height of the row.
Type
- number
Remarks:
When adding to an already output line, the height of the output line is maintained.
heights
If mergeRow exists, specify the height of each row.
Type
- number[]
Remarks:
If not specified, height is applied.
image
Add an image to a cell. Images cannot be displayed larger than their cells (including merged ones).
Type
- UserCellImage | string
Remarks:
When input as a string, the image is aligned in the center and output.
mergeCol
Number of columns when merging
Type
- number
mergeRow
Number of rows when merging
Type
- number
row
It is calculated starting from the line number to be output: 0
.
Type
- number
styleName
className to be applied to the cell
Type
- string
styles
Style applied to the cell
Type
- ConfigObject | string
Example:
var styles = {
textAlign: "center",
background: "green",
color: "red"
}
var styles2 = "text-align:center;background:green;color:red"
value
What will be printed
Type
- any
Remarks:
Enter values in the form of string, numbar, date, and boolean.
width
Specifies the width of the column.
Type
- number
Remarks:
If the column already exists, the existing width is maintained.
widths
Specifies the width of each column if mergeCol exists.
Type
- number[]
Remarks:
If not specified, width is applied.