사용자가 다운로드해야하는 Excel 파일을 생성하기 위해 컨트롤러를 목록에 전달하고 있습니다. 목록 오전 통과 10000 개 기록 컨트롤러에 목록을 보내어 Excel 파일을 다운로드하십시오.
여기 내 컨트롤러 방법 여기
[HttpPost]
public FileResult Result(List<List> Content)
{
var stream = new MemoryStream();
var serializer = new XmlSerializer(typeof(List<Content>));
var data = Transformer.TransformToExcelFormat(Content);
//We turn it into an XML and save it in the memory
serializer.Serialize(stream, data);
stream.Position = 0;
//We return the XML from the memory as a .xls file
return File(stream, "application/vnd.ms-excel", "Template.xls");
}
내 자바 스크립트
var Content = { "Content": ItemList() };
var pack = ko.toJSON(Content);
$.ajax({
url: baseUrl + '/Client/Result',
type: "POST",
datatype: "json",
data: pack,
contentType: 'application/json; charset=utf-8',
success: function (data) {
// Just wondering how to handle success result.
}
});
내가 성공으로 이어질 것입니다 제안을 주셔서 감사합니다입니다
개까지 할 수 있습니다.감사합니다.