Exemplo n.º 1
0
    //导出数据
    protected void Button2_Click(object sender, EventArgs e)
    {
        DataTable dt       = bll.GetItemExportList(userId);
        string    fileName = "AA生活记账数据导出(" + userId + userName + ").xlsx";
        string    savePath = Server.MapPath("/Backup/Export/") + fileName;

        try
        {
            AsposeExport(dt, savePath);
            DownExcel(savePath, fileName);
        }
        catch
        {
            Utility.Alert(this, "数据导出错误!");
        }
    }