We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date

Grid Export PDF functionality does not seem to work with rowtemplate

I have the following code. The "Download PDF" button works but it returns only one "ID" column(which is a width=0 column). How can I make it honor the grid rowtemplate?
i am also not able to provide a running row number for a column with the Grid rowtemplate using the queryCellinfo event.
Please help.
rowTemplate="#rowtemplate"
allowPaging="true" allowPdfExport="true" toolbarClick="toolbarClick"
toolbar="@( new List<object> {"PdfExport"})" queryCellInfo="queryCellInfo">
function toolbarClick(args)
{
var gridObj = document.getElementById("SocialMediaAccountDetails").ej2_instances[0];
if (args.item.id === 'SocialMediaAccountDetails_pdfexport')
{
var exportProperties = {fileName: "tweets.pdf"};
gridObj.pdfExport(exportProperties);
}
}
var count = 1;
function queryCellInfo(args) {
if (args.column.headerText == "Row Number") {
args.cell.innerHTML = count;
count++;
}
}

2 Replies

AG ajit goel replied to ajit goel August 18, 2019 04:14 AM UTC

I have the following code. The "Download PDF" button works but it returns only one "ID" column(which is a width=0 column). How can I make it honor the grid rowtemplate?
i am also not able to provide a running row number for a column with the Grid rowtemplate using the queryCellinfo event.
Please help.
rowTemplate="#rowtemplate"
allowPaging="true" allowPdfExport="true" toolbarClick="toolbarClick"
toolbar="@( new List<object>() {"PdfExport"})" queryCellInfo="queryCellInfo">
function toolbarClick(args)
{
var gridObj = document.getElementById("SocialMediaAccountDetails").ej2_instances[0];
if (args.item.id === 'SocialMediaAccountDetails_pdfexport')
{
var exportProperties = {fileName: "tweets.pdf"};
gridObj.pdfExport(exportProperties);
}
}
var count = 1;
function queryCellInfo(args) {
if (args.column.headerText == "Row Number") {
args.cell.innerHTML = count;
count++;
}
}

Please close this item. 


DR Dhivya Rajendran Syncfusion Team August 19, 2019 12:18 PM UTC

Hi Ajit,  
  
Thanks for contacting us.   
    
We have already provided response for the query in forum #146757. Please check that forum for more information. 
  
Regards,  
R.Dhivya  


Loader.
Live Chat Icon For mobile
Up arrow icon