Kendo UI网格导出到Excel / PDF不工作在IE9上 [英] Kendo UI Grid Export to Excel / PDF not working on IE9
问题描述
我在IE9中导出Kendo UI Grid以获得excel和pdf的问题。
Everythig使用Chrome可以正常工作,但在IE9中没有任何反应。
这是我的网格。有什么问题吗?
$(#gridDetalhes)。kendoGrid({
dataSource:{
数据:myJsonList
},
excel:{
allPages:true,
fileName:SGD_Detalhes.xlsx
},
工具栏:[excel,pdf],
列:[
{field:DataInicio,width:135px,title:Início,type:date,template:'#= kendo.toString(DataInicio,dd / MM / yyyy HH:mm:ss #},
{field:DataFim,width:135px,title:Fim,键入:date,template:'#= kendo.toString(DataFim, / yyyy HH:mm:ss)#'},
{field:Duracao,width:80px,title:Duração,type:string},
{field: Gerador,width:40px,title:A / M,type:string},
{field:Identificador,width:120px标题:Identificador,键入:string},
]
});
导出功能不支持Safari,IE9及更低版本。
对于不支持的浏览器,您需要提供 proxyUrl
来指定服务器代理URL。
服务器代理实现的示例(适用于ASP.NET WebForms / API / MVC,PHP,Java / Spring MVC)
例如 - ASP.NET MVC的服务器控制器操作:
public class HomeController
{
[HttpPost]
public ActionResult KendoSave(string contentType,string base64,string fileName)
{
var fileContents = Convert.FromBase64String(base64);
返回文件(fileContents,contentType,fileName);
}
}
然后你需要提供指向这个的proxyUrl参数动作:
excel:{
allPages:true,
fileName:SGD_Detalhes.xlsx
proxyURL:/ Home / KendoSave,
}
希望它有帮助。 / p>
I´m having problem to export Kendo UI Grid to excel and pdf in IE9.
Everythig works fine using Chrome but in IE9 nothing happens.
Here is my grid. Is there something wrong or missing?
$("#gridDetalhes").kendoGrid({
dataSource: {
data: myJsonList
},
excel: {
allPages: true,
fileName: "SGD_Detalhes.xlsx"
},
toolbar: ["excel", "pdf"],
columns: [
{ field: "DataInicio", width: "135px", title: "Início", type: "date", template: '#= kendo.toString(DataInicio,"dd/MM/yyyy HH:mm:ss") #' },
{ field: "DataFim", width: "135px", title: "Fim", type: "date", template: '#= kendo.toString(DataFim,"dd/MM/yyyy HH:mm:ss") #' },
{ field: "Duracao", width: "80px", title: "Duração", type: "string" },
{ field: "Gerador", width: "40px", title: "A/M", type: "string" },
{ field: "Identificador", width: "120px", title: "Identificador", type: "string" },
]
});
The export function does not support Safari, IE9 and below.
For unsupported browsers, you need to provide the proxyUrl
to specify the server proxy URL.
See examples of Server Proxy Implementations (for ASP.NET WebForms/API/MVC, PHP, Java/Spring MVC)
For example - server controller action for ASP.NET MVC:
public class HomeController
{
[HttpPost]
public ActionResult KendoSave(string contentType, string base64, string fileName)
{
var fileContents = Convert.FromBase64String(base64);
return File(fileContents, contentType, fileName);
}
}
And then you need to provide proxyUrl parameter pointing to this action:
excel: {
allPages: true,
fileName: "SGD_Detalhes.xlsx"
proxyURL: "/Home/KendoSave",
}
Hope it helps.
这篇关于Kendo UI网格导出到Excel / PDF不工作在IE9上的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!