- Home
- Forum
- ASP.NET Core - EJ 2
- Unable to Export PDF with ejs-grid
Unable to Export PDF with ejs-grid
Hello Support,
I am getting an issue with PDF export. I have added ejs-grid with childGrid and toolbar options: "Search", "Print", "ExcelExport", "PdfExport"
All tools are working except PdfExport.
When I click on PdfExport then it is showing error in browser console below and when I remove the child grid the PDF export is working fine.
So something problem is with ChildGrid, but I am unable to identify it.
Here is browser console error:
constants.js:93 Uncaught (in promise) Error: IndexOutOfRangeException
at e.getCell (constants.js:93)
at f (constants.js:93)
at y (constants.js:93)
at e.processGridHeaders (constants.js:93)
at e.processGridExport (constants.js:93)
at constants.js:93
at new Promise ()
at e.processExport (constants.js:93)
at constants.js:93
---------------------------------------
Here is the code I have implemented:
Grid:
--------------------
ChildGrid:
var ChildGrid = new Syncfusion.EJ2.Grids.Grid()
{
DataSource = (IEnumerable<object>)ViewBag.PriceDatasource,
Script:
QueryString = "purchaseOrderId",
Columns = new List
{
new Syncfusion.EJ2.Grids.GridColumn() { Field = "product.productName", HeaderText = "Product Name", Width = "200", TextAlign = Syncfusion.EJ2.Grids.TextAlign.Left },
new Syncfusion.EJ2.Grids.GridColumn() { Field = "product.productCode", HeaderText = "Product Code", Width = "100", TextAlign = Syncfusion.EJ2.Grids.TextAlign.Left },
new Syncfusion.EJ2.Grids.GridColumn() { Field = "discountAmount", HeaderText = "Discount Amount", Width = "100", TextAlign = Syncfusion.EJ2.Grids.TextAlign.Left },
new Syncfusion.EJ2.Grids.GridColumn() { Field = "price", HeaderText = "Price", Width = "100", Format = "c2", TextAlign = Syncfusion.EJ2.Grids.TextAlign.Left },
new Syncfusion.EJ2.Grids.GridColumn() { Field = "qty", HeaderText = "Quantity", Width = "100", Format = "c2", TextAlign = Syncfusion.EJ2.Grids.TextAlign.Left },
new Syncfusion.EJ2.Grids.GridColumn() { Field = "totalAmount", HeaderText = "Total Amount", Width = "100", Format = "c2", TextAlign = Syncfusion.EJ2.Grids.TextAlign.Left },
}
};
-----------------------------------
function treeGridToolbarClick(args) {
var gridObj = document.getElementById("TreeGrid").ej2_instances[0];
if (args.item.id === gridObj.element.id + '_excelexport') {
gridObj.excelExport();
}
if (args.item.id === gridObj.element.id + '_pdfexport') {
gridObj.pdfExport();
}
}
Please help to find out the issue.
Thanks.
SIGN IN To post a reply.
4 Replies
SL
Sowmiya Loganathan
Syncfusion Team
May 25, 2020 12:24 PM UTC
Hi Nitish,
Thank you for contacting Syncfusion support.
We have forwarded this to our development team and will update the further details on May 26th, 2020.
Regards,
Sowmiya Loganathan
BS
Balaji Sekar
Syncfusion Team
May 26, 2020 09:11 AM UTC
Hi Nitish,
We have already fixed the reported issue “Throws scripts error while exporting the Hierarchy Grid” in our 18.1.52 release. So kindly upgrade to our latest version (18.1.53) to resolve the reported issue. Please find the release notes regarding the same from below
In our Essential Studio 2020 Volume 1 Service Pack1 release v18.1.52 is rolled out and is available for download under the following link.
Regards,
Balaji Sekar
NI
Nitish
May 29, 2020 06:27 AM UTC
Hi Balaji,
I have upgraded to latest version but its not solved the problem.
My grid was same as this: https://ej2.syncfusion.com/aspnetcore/Grid/MasterDetailsExport#/material
I did same according to this demo but it was not working.
Aftet that I tried with Essential Studio and it has download all the live demos at local end. I checked above demo at local end and Only the difference was JS file.
This file was missing: ej2.min.js
Thank you so much... Balaji to share the link of Essential Studio. It is very helpful further.
BS
Balaji Sekar
Syncfusion Team
June 1, 2020 11:10 AM UTC
Hi Nitish,
We are glad that your issue has been fixed.
Regards,
Balaji Sekar
SIGN IN To post a reply.
- 4 Replies
- 3 Participants
-
NI Nitish
- May 23, 2020 10:44 AM UTC
- Jun 1, 2020 11:10 AM UTC