private void ReportPrintForm_Click(object sender, EventArgs e) { try { ReportPrintForm form; if (!formPool.ContainsKey(ReportScreen)) { form = new ReportPrintForm(UserName, string.Empty); form.MdiParent = this; permissionComponent.SetPermissionComponentByScreen(form); formPool.Add(ReportScreen, form); } else { form = (ReportPrintForm)formPool[ReportScreen]; } form.Show(); form.FormClosing += new FormClosingEventHandler(validationForm_FormClosing); form.WindowState = FormWindowState.Minimized; form.WindowState = FormWindowState.Maximized; } catch (Exception ex) { log.Error(String.Format("Exception : {0}", ex.StackTrace)); } }
private void btnReport_Click(object sender, EventArgs e) { try { if (modeFlg == 4) { ReportPrintForm fReport = new ReportPrintForm(UserName, "R04"); fReport.StartPosition = FormStartPosition.CenterScreen; fReport.Show(); } else if (modeFlg == 3) { ReportPrintForm fReport = new ReportPrintForm(UserName, "R27"); fReport.StartPosition = FormStartPosition.CenterScreen; fReport.Show(); } else { ReportPrintForm fReport = new ReportPrintForm(UserName, "R03"); fReport.StartPosition = FormStartPosition.CenterScreen; fReport.Show(); } ////downloadMasterBLL.ExportExcel(dataType, modeFlg); //Loading_Screen.ShowSplashScreen(); //DataTable searchResult = new DataTable(); //string reportPath = ""; //if (modeFlg == 4) //{ // searchResult = downloadMasterBLL.ExportPDF4(modeFlg); // reportPath = "/ReportTemplate/MasterReport_4.rpt"; //} //else if(modeFlg == 3) //{ // searchResult = downloadMasterBLL.ExportPDF123(modeFlg); // reportPath = "/ReportTemplate/MasterReport_3.rpt"; //} //else //{ // searchResult = downloadMasterBLL.ExportPDF123(modeFlg); // reportPath = "/ReportTemplate/MasterReport_12.rpt"; //} //if (searchResult.Rows.Count > 0) //{ // MasterReportForm masterReport = new MasterReportForm(); // bool isCreateReportSuccess = masterReport.CreateReport(searchResult, reportPath, dataType, modeFlg); // Loading_Screen.CloseForm(); // if (isCreateReportSuccess) // { // masterReport.StartPosition = FormStartPosition.CenterParent; // DialogResult dialogResult = masterReport.ShowDialog(); // } // else // { // MessageBox.Show(MessageConstants.cannotgeneratereport, MessageConstants.TitleError, MessageBoxButtons.OK, MessageBoxIcon.Error); // } // //masterReport.ExportToDisk(CrystalDecisions.Shared.ExportFormatType.PortableDocFormat, fullexportPath); //} //else //{ // Loading_Screen.CloseForm(); // MessageBox.Show(MessageConstants.NoDatafound, MessageConstants.TitleInfomation, MessageBoxButtons.OK, MessageBoxIcon.Information); //} } catch (Exception ex) { log.Error(String.Format("Exception : {0}", ex.StackTrace)); } }