[英]kendo extract data to pdf file doesn't work asp.net mvc
我已經將kendo網格的提取選項實現為PDF文件,我在以下的kendo論壇中找到了解決方案:
http://demos.telerik.com/aspnet-mvc/grid/pdf-export
我已按照說明安裝了pako.min.js腳本,並更新了Kendo版本:我安裝了2015年第一季度
即使當我從劍道網格中提取數據時,我得到的屏幕打印僅包含第一個劍道頁面的數據,我的劍道網格代碼也是如此:
@(Html.Kendo().Grid<GesTim.WebApp.Areas.DataManagement.ViewModels.AgencyViewModels>().Name("Agencies").HtmlAttributes(new { style = "min-height:500px;" })
.DataSource(dataSource => dataSource
.Ajax()
.Events(events => events.RequestEnd("onRequestEnd").Error("error"))
.Model(model => model.Id(c => c.Id))
.Read(read => read.Action("Get", "xxxxx"))
.Destroy(destroy => destroy.Action("Delete", "xxxx"))
.ServerOperation(true)
)
.Columns(columns =>
{
columns.Bound(c => c.Id).Filterable(ftb => ftb.Cell(cell => cell.Operator(""))).Hidden(true).Visible(false);
columns.Bound(c => c.xxx).Filterable(ftb => ftb.Cell(cell => cell.Operator("contains").ShowOperators(false)));
columns.Bound(c => c.xxxx).Filterable(ftb => ftb.Cell(cell => cell.Operator("contains").ShowOperators(false)));
columns.Command(command =>
{
command.Custom("Details").SendDataKeys(true).Click("showDetails").Text(" ");
command.Custom("Edit").SendDataKeys(true).Click("Editer").Text(" ");
command.Custom("Delete").Text(" ").Click("confirmRemove");
}).Width("150px");
})
.Events(e => e.DataBound("onRowBound"))
.ToolBar(toolbar =>
{
toolbar.Custom().Text("Ajouter xxx").Action("Create", "xxx", new { area = "DataManagement" }).HtmlAttributes(new { @class = "btn-ajouter" });
toolbar.Excel().Text("Exporter au format Excel");
**toolbar.Pdf();**
})
.Excel(excel => excel
.AllPages(true)
.FileName("Liste des xxx.xlsx")
.Filterable(true)
.ProxyURL(Url.Action("Excel_Export_Save", "xxx"))
)
**.Pdf(pdf => pdf
.AllPages()
.FileName("Liste des xxx.pdf")
.ProxyURL(Url.Action("Pdf_Export_Save", "xxx"))
)**
.Pageable(pageable => pageable
.PageSizes(true)
.ButtonCount(10))
.Groupable()
.Sortable()
.Filterable(ftb => ftb.Mode(GridFilterMode.Row))
)
實現的結果是,我得到了一個包含數據的文件,但在kedno網格中是這樣的: 還有什么錯過的嗎? 請幫忙
我詢問了劍道技術支持,他們告訴我,解決我的問題的方法是使用一種樣式來提取諸如以下波紋管的pdf文件:
<style>
/*
Use the DejaVu Sans font for display and embedding in the PDF file.
The standard PDF fonts have no support for Unicode characters.
*/
.k-grid {
font-family: "DejaVu Sans", "Arial", sans-serif;
}
/* Hide the Grid header and pager during export */
.k-pdf-export .k-grid-toolbar,
.k-pdf-export .k-pager-wrap,
.k-pdf-export a.k-button.k-button-icontext,
.k-pdf-export .k-filter-row,
.k-pdf-export .k-grouping-header,
.k-pdf-export .k-grid tr td:last-child {
display: none !important;
}
</style>
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.