****示例:http://jsfiddle.net/o8cw3vj8/12/ 我正在尝试导出kendo ui网格和网格有日期列,导出时只包含############ ...当日期年份小于或等于1900时 谢谢,****
$("#grid1").kendoGrid({
toolbar: ["excel"],
excel: {
fileName: "Kendo UI Grid Export.xlsx",
proxyURL: "http://demos.telerik.com/kendo-ui/service/export",
filterable: true
},
dataSource: {
data: [{
"Id": 1,
"Name": "John",
"DOB": "01/01/1753"
}, {
"Id": 2,
"Name": "Joe",
"DOB": "01/01/1953"
}, {
"Id": 3,
"Name": "Jack",
"DOB": "01/01/1940"
}],
schema: {
model: {
fields: {
Id: {
type: "number"
},
Name: {
type: "string"
},
DOB: {
type: "date"
}
}
}
}
},
columns: [
"Id", "Name", "DOB"
]
});
答案 0 :(得分:0)
如果您将鼠标悬停在单元格上,您将看到一条消息"日期和时间为负数或太大显示为#####"。这是一个截图:
这是因为Excel saves dates as numbers of days after 1/1/1990。在您的情况下,数字变为负数,因此显示。