Ajax调用NPOI导出Excel报表

$("#btnExcel").click(function () {
                $.ajax({
                    url: "../ashx/Report.ashx",
                    type: "post",
                    dataType: "text",
                    data: { RequestType: "ReviewReportExportExcel",
                        Site: $("#ddlSite").val(),
                        PerformanceType: $("#ddlPerformanceType").val(),
                        Period: getPeriod(),
                        OrgIDs: $("#hidDept").val(),
                        UserSapIDs: $("#hidUser").val(),
                        ProcType: $("#ddlProcType").val(),
                        Status: $("#ddlFormStatus").val(),
                        IsContainsLeavedStaff: $("#chkContainsLeavedStaff").is(':checked') ? "1" : "0",
                        LeavedBeginDate: $("#txtLeavedBeginDate").val(),
                        LeavedEndDate: $("#txtLeavedEndDate").val(),
                        CurtureID: curtureID,
                        IsPage: "0",
                        PageSize: pageSize,
                        PageIndex: "1"
                    },
                    success: function (data) {
                        window.location.replace("../" + data);  //data 为返回生成在服务器的文件路径
                    }
                });
            })

posted on 2015-03-13 18:07  LingoLiang  阅读(680)  评论(0编辑  收藏  举报

导航