ParamQuery grid support forum
General Category => Help for ParamQuery Pro => Topic started by: queensgambit9 on January 08, 2018, 01:52:50 pm
-
Is it possible to have HTML in column header (in title) which does not get included when exporting?
-
There is no direct option to exclude it.
Looking into alternative ways to do that.
-
Theoretically anything is possible with help of powerful js workbook :) as it gives access to low level structure of the worksheet.
listener: function() {
var w = this.exportData({
format: 'xlsx',
workbook: true
});
//clean all cells in first row.
pq.excel.eachCell([w.sheets[0].rows[0]], function(cell) {
cell.value = cell.value.replace(/<.*?>/g, "")
})
var blob = pq.excel.exportWb({
workbook: w,
type: 'blob'
});
saveAs(blob, "pqGrid.xlsx");
}
Please check this example to remove html from ProductID header cell.
https://plnkr.co/edit/VCU57nr1hmtCGx7no8cG?p=preview
-
Thanks.
I am also using HTML in grid title, which gives issues when exporting to Excel.
Possible to solve aswell?
-
The above mentioned solution is for you.
-
Not sure I follow...the grid title is not in the cells, but gives error message when opening the exported file...
-
Please make changes in the above plnkr to reproduce the error so that I can look into it.
-
Couldn't recreate in your code.
Solved by setting option sheetName, seems name used from title caused some error when using HTML.
Thanks.