Ejemplo n.º 1
0
        /// <summary>
        /// Views the report.
        /// </summary>
        public void ViewReport(bool isPrint, string reportId)
        {
            try
            {
                GlobalVariable.DateRangeSelectedIndex = dtReportPeriod.cboDateRange.SelectedIndex;
                GlobalVariable.FromDate             = dtReportPeriod.FromDate;
                GlobalVariable.ToDate               = dtReportPeriod.ToDate;
                GlobalVariable.AmountTypeViewReport = cboAmountType.SelectedIndex + 1;
                GlobalVariable.CurrencyViewReport   = cboCurrencyCode.EditValue.ToString();
                //ReportTool.CommonVariable = GlobalVariable;

                // Một số báo cáo dùng dataset sẽ in cách khác
                switch (reportId)
                {
                case CommonText.ReportS33_H:
                    ShowS33H(reportId);
                    break;

                case CommonText.ReportS61H:
                    ShowS61H(reportId);
                    break;

                default:
                    ReportTool.PrintPreview(this, _reportList, reportId, isPrint);
                    break;
                }

                dtReportPeriod.cboDateRange.SelectedIndex = GlobalVariable.DateRangeSelectedIndex;
            }
            catch (Exception ex)
            {
                XtraMessageBox.Show(ex + "Lỗi:" + ex.InnerException);
            }
        }
Ejemplo n.º 2
0
 /// <summary>
 /// Views the report.
 /// </summary>
 private void ViewReport(bool isPrint)
 {
     try
     {
         var reportId = gridReportDetailView.GetFocusedRowCellValue("ReportID").ToString();
         GlobalVariable.DateRangeSelectedIndex = dateTimeRangeV.cboDateRange.SelectedIndex;
         GlobalVariable.FromDate             = dateTimeRangeV.FromDate;
         GlobalVariable.ToDate               = dateTimeRangeV.ToDate;
         GlobalVariable.AmountTypeViewReport = cboAmountType.SelectedIndex + 1;
         GlobalVariable.CurrencyViewReport   = cboCurrencyCode.EditValue.ToString();
         ReportTool.CommonVariable           = CommonVariable;
         ReportTool.PrintPreview(this, _reportList, reportId, isPrint);
         dateTimeRangeV.cboDateRange.SelectedIndex = GlobalVariable.DateRangeSelectedIndex;
     }
     catch (Exception ex)
     {
         XtraMessageBox.Show(ex + "Lỗi:" + ex.InnerException);
     }
 }