How can I prepend a regular excel row above the table data when exporting to excel? There is a "from" and "to" filter option, but this seems to only affect the column index.
filter: { from: 1, to: 2 }
Changing this from an integer to a string results in a corrupted excel file:
filter: { from: "A2", to: "B2" }
The documentation doesn't seem to mention any other properties for the filter.
I have tried changing the sheets.rows.type
option from data
to header
but that doesn't seem to do anything.
Example export:
var workbook = new kendo.ooxml.Workbook({
sheets: [
{
filter: { from: 1, to: 2 },
rows: [
// row above table
{ cells: [ { value: "pre table header", "colSpan": 4 } ] },
// table: header
{ cells: [ { value: "First Name" }, { value: "Last Name" } ] },
// table: data
{ cells: [ { value: "John" }, { value: "Doe" } ] },
{ cells: [ { value: "Jane" }, { value: "Doe" } ] }
]
}
]
});
kendo.saveAs({
dataURI: workbook.toDataURL(),
fileName: "Test.xlsx"
});
https://dojo.telerik.com/emUzuPeq
What I am trying to achieve:
What the above code does: