private void PrintReport(bool isPrint, ExportFormatType exportFormat = ExportFormatType.NoFormat) { try { this.Cursor = Cursors.WaitCursor; if (gvResult.CurrentRow.Index >= 0) { sp_RPT002_GetWorkPlaceAir_Result row = gvResult.Rows[gvResult.CurrentRow.Index].DataBoundItem as sp_RPT002_GetWorkPlaceAir_Result; using (RPT002_Process rpt = new RPT002_Process(row.ID)) { if (isPrint) { rpt.PrintReport(); } else if (!isPrint && exportFormat == ExportFormatType.NoFormat) { rpt.PreviewDialog(); } else if (exportFormat == ExportFormatType.Excel) { rpt.ExportExcelSpecial(); } else if (!isPrint) { rpt.Export(exportFormat); } else { rpt.PrintReport(); } } } } catch (Exception ex) { rMessageBox.ShowException(this, ex); } finally { this.Cursor = Cursors.Default; } }
private void PrintReport(bool isPrint, ExportFormatType exportFormat = ExportFormatType.NoFormat) { try { this.Cursor = Cursors.WaitCursor; using (RPT002_Process rpt = new RPT002_Process(this.wpaResult.ID)) { if (isPrint) { rpt.PrintReport(); } else if (!isPrint && exportFormat == ExportFormatType.NoFormat) { rpt.PreviewDialog(); } else if (exportFormat == ExportFormatType.Excel) { rpt.ExportExcelSpecial(); } else if (!isPrint) { rpt.Export(exportFormat); } else { rpt.PrintReport(); } } } catch (Exception ex) { rMessageBox.ShowException(this, ex); } finally { this.Cursor = Cursors.Default; } }