2015-01-05 4 views
4


IE9에서 Excel 및 Excel로 내보내기 위해 Kendo UI Grid를 내보내는 데 문제가 있습니다.
Everythig는 Chrome을 사용하여 정상적으로 작동하지만 IE9에서는 아무런 문제가 발생하지 않습니다.
여기 내 표입니다. 뭔가 잘못되었거나 누락 되었습니까?
Kendo UI Grid IE9에서 Excel/PDF로 내보내기가 작동하지 않습니다.

 $("#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" }, 

      ] 


     }); 

답변

0

는 검도 UI는

또한 엄격한 엄격한 또는 HTML4 마크 업에 XHTML 1.1, XHTML 1.0과 같은 않은 doctype을 추천

<meta http-equiv="X-UA-Compatible" content="IE=edge" /> 
+0

나는 이것을 시도했지만 아무 일도 일어나지 않습니다. 어쩌면 내 IE를 구성해야합니다. 그렇지 않으면 – Goldar

7

META 태그 또는 HTTP 헤더를 통해 IE의 가장자리 모드를 사용 지정 내보내기 기능은 Safari, IE9 이하를 지원하지 않습니다. 지원되지 않는 브라우저의 경우 서버 프록시 URL을 지정하려면 proxyUrl을 제공해야합니다.

Server Proxy Implementations의 예를 참조 (대한 ASP.NET 웹폼/API/MVC, PHP, 자바/스프링 MVC)

예를 들어

- 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); 
    } 
} 

그리고 다음이 작업을 가리키는 proxyUrl 매개 변수를 제공해야합니다.

excel: { 
       allPages: true, 
       fileName: "SGD_Detalhes.xlsx" 
       proxyURL: "/Home/KendoSave", 
     } 

희망이 있습니다.

+0

확인. 그것은 효과가 있었다. 고맙습니다. – Goldar

0

동일한 문제로 서버 측을 구현하는 데 어려움을 겪었으므로 가장 단순한 nodejs 버전으로 끝났습니다. 코드는 다음과 같습니다.

var fs = require('fs'); 
var express = require('express'); 
var bodyParser = require('body-parser'); 
var app = express(); 
app.use(bodyParser.json()); // for parsing application/json 
app.use(bodyParser.urlencoded({ extended: true })); // for parsing application/x-www-form-urlencoded 
app.post('/save', function(req,res){ 
    var fContents = req.body.base64; 
    var fName = req.body.fileName; 
    var buffer = new Buffer(fContents, 'base64'); 
    res.setHeader('Content-disposition', 'attachment; filename=' + fName); 
    res.send(buffer); 
}) 
app.listen(80); 
관련 문제