Hi!
I'm trying to export my grid content to .pdf using the built-in grid.pdfExport(); function. It is working fine, but when the grid data contains an 'ő' or 'ű' character in any of the cells, the export throws an error: "Uncaught (in promise)".
I'm using the standard export functions from the toolbar:
grid.toolbarClick = function(args) {
if (args['item'].id === 'ej2grid_excelexport') {
grid.excelExport();
}
if (args['item'].id === 'ej2grid_pdfexport') {
grid.pdfExport();
}
}
The grid's config:
var grid = new ej.grids.Grid({
allowSorting: '1',
allowFiltering: '1',
allowPaging: '1',
pageSettings: { pageSize: 3 },
dataSource: data,
columns: ...,
filterSettings: {
mode: 'Immediate',
enableCaseSensitivity: true
},
allowExcelExport: '1',
allowPdfExport: '1',
toolbar: JSON.parse('["ExcelExport","PdfExport"]'),
queryCellInfo: setButtonColumn,
allowTextWrap: true
});
Do I have to set something else?
Thank you!
|
let grid: Grid = new Grid(
{
dataSource: orderDetails,
allowExcelExport: true,
allowPdfExport: true,
allowPaging: true,
toolbar: ['PdfExport'],
pageSettings: { pageCount: 5 },
columns: [
. . . . . . . .
. . . . . . . .
]
});
grid.appendTo('#Grid');
grid.toolbarClick = (args: ClickEventArgs) => {
if (args.item.id === 'Grid_pdfexport') {
let pdfExportProperties = {
theme: {
header: { font: new PdfTrueTypeFont(adventProFont, 12) },
caption: { font: new PdfTrueTypeFont(adventProFont, 10) },
record: { font: new PdfTrueTypeFont(adventProFont, 9) }
}
};
grid.pdfExport(pdfExportProperties);
}
};
|