.net core kendo ui
grid has a toolbar template however on pdf export by default it should export with toolbar template but its not, i am not hiding it on export either
is there anything i am missing
.ToolBar(toolbar => { toolbar.ClientTemplateId("PatientGridToolbarTemplate");
}) .Columns(columns
6 Answers, 1 is accepted
When the "paperSize" property of the PDF configuration is set, the toolbar and the pager will not be exported and I have to say that the only workaround that I could suggest is to remove it (if it is applicable):
Please excuse us for any inconvenience caused by this limitation.
Regards,
Konstantin Dikov
Progress Telerik

Hi Dikov,
i have the below settings, however i still dont see toolbar is there anything i am missing
.ToolBar(toolbar =>
{
toolbar.ClientTemplateId("PatientGridToolbarTemplate");
})
.Pdf(p=>p.FileName("MockReport.pdf"))
Could you please share the entire configuration of the Grid and if possible, a runnable sample project replicating the issue, so we can test and debug it locally?
Looking forward to your reply.
Regards,
Konstantin Dikov
Progress Telerik

Hi Dikov,
here is the template
<script id="PatientGridToolbarTemplate" type="text/x-kendo-template">
<div class="k-toolbar">
<div style="border:1px solid black;width:35%;float:left;padding:10px;">
<div>Scenario: <b>@ViewBag.Rule</b></div>
<div>Description: <b>@ViewBag.RuleDescription</b></div>
<div>
<div style="float:left">
Run Date: <b>@DateTime.Now.ToShortDateString() </b>
</div>
@if (Common.HasClaim("ViewRule", "1"))
{
<div style="float:right;padding-left:20px;">
Rule Version: <a id='RulebyVersion' style='color:black;text-decoration:none' href='/Rule/DisplayRule?RuleId=@Model&ViewActive=true'><b>@ViewBag.RuleVersion</b></a>
</div>
}
else
{
<div style="float:right;padding-left:20px;">
Rule Version: <b>@ViewBag.RuleVersion</b>
</div>
}
</div>
<br />
<div>Data Ingestion: <b>@ViewBag.DataIngestion.ToShortDateString()</b></div>
<div> Rule Engine: <b>@ViewBag.RuleEngine</b></div>
</div>
<div style="border:1px solid black;float:right;width:20%;padding:10px;margin-right: 5%;">
<div> Total Patient Population: <b id="TotalPatients">@ViewBag.TotalPatients</b></div>
<div>
<div style="float:left"> Matching Patient Population: @ViewBag.Percentage <b id="MatchingPatients"></b> </div> <div style="float:right;"> <b id="MatchingPercentage"></b></div>
</div>
</div>
<div style="float:left;width:100%;padding-bottom:5px">
<div style="float:left;width:30%;padding:4px;">
<a role="button" class="k-button k-button-icontext k-grid-excel" href="\\#"><span class="k-icon k-i-file-excel"></span>export to excel</a>
<a role="button" id="gridExportPdf" class="k-button k-button-icontext k-grid-pdf" href="\\#"><span class="k-icon k-i-file-pdf"></span>export to pdf</a>
</div>
</div>
</div>
</script>
here is the grid settings I have, grid has 10fields
.ToolBar(toolbar =>
{
toolbar.ClientTemplateId("PatientGridToolbarTemplate");
})
.Pdf(p=>p.FileName("MockReport.pdf"))
There could be some CSS that explicitly hides the toolbar on export, because with the above settings, the toolbar is exported as expected on my side:
@(Html.Kendo().Grid<
Kendo.Mvc.Examples.Models.Customer
>()
.Name("grid")
.ToolBar(toolbar =>
{
toolbar.ClientTemplateId("PatientGridToolbarTemplate");
})
.Pdf(pdf => pdf
.AllPages()
.FileName("someFileName.pdf")
)
You could check if you have the following somewhere in your project:
.k-pdf-export .k-grid-toolbar,
.k-pdf-export .k-pager-wrap
{
display: none;
}
Regards,
Konstantin Dikov
Progress Telerik

thank you,
i finally found the prob