internal bool SendExcel() { if (batchSet.ShowDialog() == DialogResult.Cancel) { return(false); } string xlsName = string.Empty; Com.Bing.Business.StorageDataSet dataSet = this.projectManager.ProjectData as Com.Bing.Business.StorageDataSet; DataTable dtGcDescription = dataSet.Tables["GcDescription"]; string order = dtGcDescription.Columns.Contains("gc_chandle") ? "gc_chandle" : ""; DataRow[] row = dtGcDescription.Select("DescriptionName = '工程名称'", order); if (row.Length > 0) { xlsName = row[0]["DescriptionValue"].ToString(); } else { xlsName = "批量导出数据"; } if (XLSFile.ShowSaveFile(ref xlsFilePath, xlsName)) { Function.TransBegin(xlsFilePath); backgroundWorker.RunWorkerAsync("send"); return(true); } return(false); }
internal void SendToExcelAsPart() { StringBuilder vbaBuilder = new StringBuilder(); drawManager.Send(vbaBuilder); XLSFile.Generate(vbaBuilder, DesrcName); }
public void SendToExcel(string xlsFile) { if (string.IsNullOrEmpty(docPath)) { StringBuilder vbaBuilder = new StringBuilder(); drawManager.Send(vbaBuilder); XLSFile.Generate(xlsFile, vbaBuilder, DesrcName); } }
public void sendtoexcel_Click(object sender, EventArgs e) { string xlsFile = string.Empty; //WORD格式的报表不允许发送EXCEL if (curReport != null && !curReport.IsDoc && XLSFile.ShowSaveFile(ref xlsFile, curReport.DesrcName)) { curReport.InitReportData(projectDataManager, 0); curReport.MutliProjectSendToExcel(xlsFile); Function.Alert("发送成功!", "提示"); } }
internal void MutliProjectSendToExcel(string xlsFile) { for (int i = 0; i < MutliProjectCount; i++) { DataAnalyse.Save(); StringBuilder vbaBuilder = new StringBuilder(); InitReportDataByPrjIndex(i); drawManager.Send(vbaBuilder, true); XLSFile.Generate(xlsFile, vbaBuilder, DesrcName); DataAnalyse.Cover(); } }
private void sendToXls_Click(object sender, EventArgs e) { string xlsFilePath = ""; if (XLSFile.ShowSaveFile(ref xlsFilePath, report.DesrcName)) { if (report.ProjectDataManager != null) { report.MutliProjectSendToExcel(xlsFilePath); } else { report.SendToExcel(xlsFilePath); } Function.Alert("发送完成!", "提示"); } }