protected void DownExcel_Btn_Click(object sender, EventArgs e)
        {
            M_Pub_Excel excelMod = new M_Pub_Excel();
            B_Pub_Excel excelBll = new B_Pub_Excel();
            M_Pub       pubinfo  = pub.GetSelect(PubID);

            excelMod = excelBll.SelByTbName(pubinfo.PubTableName);
            if (excelMod == null)
            {
                function.WriteErrMsg("尚未为表:" + pubinfo.PubTableName + "指定导出规则,请先<a href='PubExcel.aspx?mid=" + pubinfo.PubModelID + "'>点此设定导出规则</a>");
            }
            OfficeHelper ofHelper = new OfficeHelper();

            SafeC.DownStr(ofHelper.GetExcelByDT(GetDT(), excelMod.Fields, excelMod.CNames), DateTime.Now.ToString("yyyyMMdd") + "互动信息.xls", Encoding.Default);
        }
Esempio n. 2
0
        //Excel下载
        protected void DownExcel_Btn_Click(object sender, EventArgs e)
        {
            M_Pub_Excel excelMod = new M_Pub_Excel();
            B_Pub_Excel excelBll = new B_Pub_Excel();
            int         pubid    = Convert.ToInt32(Request.QueryString["PubID"]);
            M_Pub       pubinfo  = pub.GetSelect(pubid);

            excelMod = excelBll.SelByTbName(pubinfo.PubTableName);
            if (excelMod == null)
            {
                function.WriteErrMsg("尚未为表:" + pubinfo.PubTableName + "指定导出规则,请先<a href='PubExcel.aspx'>点此设定导出规则</a>");
            }
            OfficeHelper ofHelper = new OfficeHelper();

            SafeSC.DownStr(ofHelper.GetExcelByDT(GetDT(), excelMod.Fields, excelMod.CNames), "互动回复.xls");
        }