Hi Charles,
Thanks for contacting Syncfusion support.
Query: I am trying to add a header when exporting to excel. There should be two different cells in the header but only the first one appears.
We have analyzed your query at our end. By validating your code, we found that the index is not defined to the cells used in headerRows. This is the cause of reported behavior. You can resolve the reported behavior by using following code example.
[app.component.ts]
const excelExportProperties1: any = {
header: {
headerRows: 1,
rows: [
{
cells: [
{
index: 1, // provide the index of the cell
colSpan: 4,
value: 'This is a Real Corporation',
style: {
fontColor: '#ffffff',
hAlign: 'Center',
backColor: '#467FA5',
},
},
{
index: 5, // provide the index of the cell
colSpan: 2,
value: 'Test',
style: {
fontColor: '#ffffff',
hAlign: 'Center',
backColor: '#90AFC4',
},
},
],
},
],
},
};
this.grid.excelExport(excelExportProperties1);
|
We have prepared a sample for your reference. You can get it from the below link.
Please get back to us if you need further assistance with this.
Regards,
Rajapandiyan S