winform下用NOPI导出excel怎么写

时间:2022-11-22 19:15:44

SaveFileDialog sfd = new SaveFileDialog();
            sfd.FileName = ((DateTime)MonthEdit.EditValue).ToString("yyyyMM");
            sfd.DefaultExt = "xls";
            if (resultDt != null)
            
                #region
                                   try
                    {
                        string stitle = ((DateTime)MonthEdit.EditValue).ToString("yyyy年M月份 ";

                        ReportManage.ExportDaoChuDQ("报表", stitle, resultDt);
                        SuccessMessageBox("导出完成");
                    }
                    catch (Exception ex)
                    {
                        ErrorMessageBox("导出出错,错误信息:" + ex.Message);
                    }
                
                #endregion