找回密码
 立即注册

QQ登录

只需一步,快速开始

ex_zhangp4

注册会员

4

主题

15

帖子

65

积分

注册会员

积分
65
最新发帖
ex_zhangp4
注册会员   /  发表于:2021-2-22 15:22  /   查看:2426  /  回复:1
#region 导出Excel
                    string path = ConfigurationManager.AppSettings["TempFilePath"];
                    if (!System.IO.Directory.Exists(path))
                    {
                        System.IO.Directory.CreateDirectory(path);
                    }
                    string newFilePath = "" ;
                  
                    #region xlsx                    
                    //newFilePath = path + "" + _PRODWELLTESTDAILY_MAIN_Entity.WELLNAME + " (IL FIELD PRODUCTON  WELL TEST REPORT" + txtThedate.Text + ").xlsx";
                    //FpSpread1.SaveExcel(newFilePath, FarPoint.Excel.ExcelSaveFlags.UseOOXMLFormat);
                    #endregion
                    #region xls
                    //方法一
                    newFilePath = path + "" + _PRODWELLTESTDAILY_MAIN_Entity.WELLNAME + " (IL FIELD PRODUCTON  WELL TEST REPORT" + txtThedate.Text + ").xls";
                    FpSpread1.SaveExcel(newFilePath, FarPoint.Excel.ExcelSaveFlags.NoFlagsSet);
                    //方法二
                    FpSpread1.SaveExcel(newFilePath, FarPoint.Web.Spread.Model.IncludeHeaders.BothCustomOnly);
                    System.IO.MemoryStream s = new System.IO.MemoryStream();
                    FpSpread1.SaveExcel(s);
                    s.Close();
                    #endregion
                    #endregion

1 个回复

倒序浏览
Richard.Ma讲师达人认证 悬赏达人认证 SpreadJS 开发认证
超级版主   /  发表于:2021-2-22 18:17:30
沙发
这个是为上个帖子分享出的你那边的正确代码吗?
回复 使用道具 举报
您需要登录后才可以回帖 登录 | 立即注册
返回顶部