示例#1
0
        public virtual CrystalDecisions.CrystalReports.Engine.ReportDocument CreateReport()
        {
            CurrentDayMetersReport rpt = new CurrentDayMetersReport();

            rpt.Site = this.Site;
            return(rpt);
        }
        public void PrintCurrentDayMeterReport(DataTable meterData)
        {
            string strConnect = string.Empty;
            string sVersion = string.Empty;
            string sSiteName = string.Empty;
            try
            {
                LogManager.WriteLog("Inside PrintCurrentDayMeterReport method", LogManager.enumLogLevel.Info);

                CurrentDayMetersReport currentMetersReport = new CurrentDayMetersReport();

                currentMetersReport.SetDataSource(meterData);

                GetVersion_SiteName(out  sVersion, out  sSiteName);

                currentMetersReport.SetParameterValue("SiteCode", Settings.SiteCode);
                currentMetersReport.SetParameterValue("Site", sSiteName);
                currentMetersReport.SetParameterValue("Version", sVersion);
                currentMetersReport.SetParameterValue("DateCulture", ExtensionMethods.CurrentDateCulture);

                crystalReportViewer.ReportSource = currentMetersReport;

                LogManager.WriteLog("Report Source set successfully.", LogManager.enumLogLevel.Info);

                LogManager.WriteLog("Printing Report...", LogManager.enumLogLevel.Info);

                crystalReportViewer.PrintReport();

                LogManager.WriteLog("Report printed successfully ...", LogManager.enumLogLevel.Info);

                AuditReports();

                strReportName = "Current Day Meter Report";

            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
 public virtual CrystalDecisions.CrystalReports.Engine.ReportDocument CreateReport() {
     CurrentDayMetersReport rpt = new CurrentDayMetersReport();
     rpt.Site = this.Site;
     return rpt;
 }