private void GetExpiredVoucherCouponReport(DateTime dtFromDate, DateTime dtToDate, string sDeviceType) { try { LogManager.WriteLog("Inside GetExpiredVoucherCouponReport method", LogManager.enumLogLevel.Info); if (dtFromDate > dtToDate) { MessageBox.ShowBox("MessageID286", BMC_Icon.Information); return; } if (dtFromDate > System.DateTime.Now) { MessageBox.ShowBox("MessageID287", BMC_Icon.Information); return; } if (dtToDate > System.DateTime.Now) { MessageBox.ShowBox("MessageID288", BMC_Icon.Information); return; } IReports objReports = ReportsBusinessObject.CreateInstance(); DataSet dtDataset = objReports.GetExpiredVoucherCouponReport(dtFromDate, dtToDate, sDeviceType); if (dtDataset.Tables[0].Rows.Count == 0) { MessageBox.ShowBox("MessageID261", BMC_Icon.Information); return; } using (CReportViewer cReportViewer = new CReportViewer()) { cReportViewer.ShowExpiredVoucherCoupon("ExpiredVoucherCoupon", dtDataset, dtFromDate, dtToDate, sDeviceType); cReportViewer.ShowDialog(); } } catch (Exception ex) { ExceptionManager.Publish(ex); MessageBox.ShowBox("MessageID262", BMC_Icon.Error); } }