|
@@ -1808,6 +1808,13 @@ namespace OTSIncAReportGrids
|
|
|
if (sfd.ShowDialog() == DialogResult.OK)
|
|
|
{
|
|
|
Cursor = Cursors.WaitCursor;
|
|
|
+
|
|
|
+ //var progr = new Frm_UserProgress();
|
|
|
+ if (m_frm_userprogress.IsDisposed)
|
|
|
+ {
|
|
|
+ ProgressStart();
|
|
|
+ }
|
|
|
+
|
|
|
//IWorkbook workbook = new HSSFWorkbook(); //用于创建.xls office2003开始以前的
|
|
|
IWorkbook workbook = new NPOI.XSSF.UserModel.XSSFWorkbook(); //用于创建.xlsx office2007开始以后的
|
|
|
ISheet sheet;
|
|
@@ -1855,8 +1862,8 @@ namespace OTSIncAReportGrids
|
|
|
|
|
|
cell.SetCellValue(dgV_ParticlesDevidePage.Columns[i_cell].HeaderText);
|
|
|
}
|
|
|
+ m_frm_userprogress.SetProgressValueAndText(0, "export:"+"0"+"/total:"+ dgV_ParticlesDevidePage.Rows.Count);
|
|
|
|
|
|
-
|
|
|
IClientAnchor anchor;
|
|
|
int pictureIdx;
|
|
|
Bitmap bp;
|
|
@@ -1865,6 +1872,11 @@ namespace OTSIncAReportGrids
|
|
|
//插入表内容
|
|
|
for (int i_row = 0; i_row < dgV_ParticlesDevidePage.Rows.Count; i_row++)
|
|
|
{
|
|
|
+ if (dgV_ParticlesDevidePage.Rows.Count > 100)
|
|
|
+ {
|
|
|
+ if (i_row%(dgV_ParticlesDevidePage.Rows.Count / 100) == 0)
|
|
|
+ m_frm_userprogress.SetProgressValueAndText(i_row / (dgV_ParticlesDevidePage.Rows.Count / 100), "export:" + i_row + "/total:" + dgV_ParticlesDevidePage.Rows.Count);
|
|
|
+ }
|
|
|
row = sheet.CreateRow(2 + i_row);
|
|
|
row.Height = 45 * 20;
|
|
|
for (int i_cell = 0; i_cell < dgV_ParticlesDevidePage.Columns.Count; i_cell++)
|
|
@@ -1994,7 +2006,10 @@ namespace OTSIncAReportGrids
|
|
|
workbook.Write(file);
|
|
|
file.Close();
|
|
|
|
|
|
- MessageBox.Show("Export complete!");
|
|
|
+ //MessageBox.Show("Export complete!");
|
|
|
+ //m_frm_userprogress.SetProgressValueAndText(100, "export:" + dgV_ParticlesDevidePage.Rows.Count + "/total:" + dgV_ParticlesDevidePage.Rows.Count);
|
|
|
+ //加载完成,关闭进度条
|
|
|
+ m_frm_userprogress.Close();
|
|
|
|
|
|
Cursor = Cursors.Default;
|
|
|
//导出完成后,打开Excel文件
|
|
@@ -2006,6 +2021,7 @@ namespace OTSIncAReportGrids
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+
|
|
|
void CreateChart(IDrawing drawing, ISheet sheet, IClientAnchor anchor, int rowid)
|
|
|
{
|
|
|
var chart = drawing.CreateChart(anchor) as XSSFChart;
|