- Home
- Forum
- ASP.NET Core - EJ 2
- Grid Export PDF functionality does not seem to work with rowtemplate
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.
<script id="rowtemplate" type="text/x-template">
<div class="card">
<div class="card-body">
<div class="timeline timeline-one-side" data-timeline-content="axis" data-timeline-axis-style="dashed">
<div class="timeline-block">
<span class="timeline-step timeline-step-sm bg-primary border-primary text-white">1</span>
<div class="timeline-content">
<div class="d-block h1 text-sm mb-0">${Text}</div>
<medium><i class="fas fa-clock mr-1"></i>${CreatedAt}</medium>
<a rel='nofollow' href="#">
<img class="img-fluid" src="${MediaURLHttps}">
</a>
</div>
</div>
</div>
</div>
</div>
</script>
<ejs-grid id="SocialMediaAccountDetails" dataSource="@Model.Tweets" height="auto" rowTemplate="#rowtemplate"
allowPaging="true" allowPdfExport="true" toolbarClick="toolbarClick"
toolbar="@( new List<object>() {"PdfExport"})" queryCellInfo="queryCellInfo">
<e-grid-pageSettings pageCount="10" pageSize="5" />
<e-grid-columns>
<e-grid-column headerText=" " width="0" field="Id" textAlign="Left" />
</e-grid-columns>
</ejs-grid>
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++;
}
}
PRODUCTS
EXPLORE OUR PRODUCTS
LEARNING & SUPPORT
- Fax: +1 919.573.0306
- US: +1 919.481.1974
- UK: +44 20 7084 6215
- Toll Free: 1-888-9DOTNET
- [email protected]
SIGN IN To post a reply.
1 Reply
BS
Balaji Sekar
Syncfusion Team
August 19, 2019 11:43 AM UTC
Hi Ajit,
Thanks for contacting Syncfusion support.
We have validated your query while checking your code example we have found that you have used rowTemplate in grid column. Currently, we do not have support for pdf export with rowTemplate, because template has any html element or custom components, so it does not support PDF, so it is not feasible to export the template into PDF file.
Please get back to us if you need further assistance.
Regards,
Balaji Sekar.
SIGN IN To post a reply.
- 1 Reply
- 2 Participants
-
AG ajit goel
- Aug 18, 2019 04:14 AM UTC
- Aug 19, 2019 11:43 AM UTC