public void PrintPreviewReport(XtraForm frmParent, string reportID, bool isPint) { try { List <ReportListModel> reportList = _reportListPresenter.GetAllReportList(); ReportListModel _reportListModel = reportList.Find(item => item.ReportID == reportID); if (_reportListModel == null) { return; } // var reportListSource = GetDataSource(frmParent, _reportListModel); List <C30BBModel> lstC30BB = new List <C30BBModel>(); for (int i = 0; i < gridViewDetail.RowCount; i++) { var rowData = (C30BBModel)gridViewDetail.GetRow(i); lstC30BB.Add(rowData); } if (lstC30BB.Count <= 0) { XtraMessageBox.Show("Dữ liệu lấy lên báo cáo Không có bản ghi nào.", "Thông báo", MessageBoxButtons.OK, MessageBoxIcon.Information); return; } var reportHelper = new ReportHelper(); // reportHelper.DisplayReport(ref lstC30BB, _reportListModel, false, frmParent, false, false, DateTime.MinValue); // DisplayReport(ref reportListSource, _reportListModel, false, frmParent, false, isPint, DateTime.MinValue); // DisplayReport(lstC30BB, _reportListModel, false, frmParent, false, isPint, DateTime.MinValue); } catch (Exception ex) { XtraMessageBox.Show(ex.ToString(), "Thông báo", MessageBoxButtons.OK, MessageBoxIcon.Information); } }
/// <summary> /// Prints the data. /// </summary> protected virtual void PrintData() { try { ActionMode = ActionModeEnum.None; Cursor.Current = Cursors.WaitCursor; var reportHelper = new ReportHelper(); _reportList = _reportListPresenter.GetAllReportList(); reportHelper.ReportLists = _reportList; reportHelper.PrintPreviewReport(null, ReportID, false); } catch (Exception ex) { XtraMessageBox.Show(ex.ToString(), "Thông báo", MessageBoxButtons.OK, MessageBoxIcon.Error); } finally { Cursor.Current = Cursors.Default; } }
/// <summary> /// Loads the data. /// </summary> public void LoadData() { try { cboCurrencyCode.Properties.Items.Add(CommonVariable.CurrencyLocal); if (CommonVariable.CurrencyLocal != CommonVariable.CurrencyAccounting) { cboCurrencyCode.Properties.Items.Add(CommonVariable.CurrencyAccounting); cboCurrencyCode.EditValue = cboCurrencyCode.Properties.Items[1]; } else { cboCurrencyCode.EditValue = cboCurrencyCode.Properties.Items[0]; } _reportGroupPresenter.GetAllReportGroup(); _reportList = _reportListPresenter.GetAllReportList(); } catch (Exception ex) { XtraMessageBox.Show(ex.ToString(), "Thông báo", MessageBoxButtons.OK, MessageBoxIcon.Exclamation); } }
/// <summary> /// Prints the data. /// </summary> protected virtual void PrintData() { try { ActionMode = ActionModeEnum.None; Cursor.Current = Cursors.WaitCursor; var reportHelper = new ReportHelper(); _reportList = _reportListPresenter.GetAllReportList(); if (_reportList != null) { reportHelper.ReportLists = _reportList; reportHelper.PrintPreviewReport(null, ReportID, false); } } catch (Exception ex) { XtraMessageBox.Show("Có lỗi xảy ra trong quá trình truy vấn dữ liệu!", "Thông báo", MessageBoxButtons.OK, MessageBoxIcon.Error); } finally { Cursor.Current = Cursors.Default; } }