Ejemplo n.º 1
0
        public virtual CrystalDecisions.CrystalReports.Engine.ReportDocument CreateReport()
        {
            BatchWinLoss rpt = new BatchWinLoss();

            rpt.Site = this.Site;
            return(rpt);
        }
Ejemplo n.º 2
0
        public void ShowMachineDropReport(int BatchNo, int WeekNo)
        {
            string sVersion = string.Empty;
            string sSiteName = string.Empty;
            try
            {
                LogManager.WriteLog("Inside ShowMachineDropReport method", LogManager.enumLogLevel.Info);

                GetVersion_SiteName(out  sVersion, out  sSiteName);

                CrystalDecisions.CrystalReports.Engine.Database crDatabase;
                CrystalDecisions.CrystalReports.Engine.Tables crTables;

                TableLogOnInfo tableLogonInfo = new TableLogOnInfo();
                BatchWinLoss MachineDropReport = new BatchWinLoss();
                LogManager.WriteLog("Setting Report Datasource...", LogManager.enumLogLevel.Info);
                LogManager.WriteLog("Report DataSource set successfully", LogManager.enumLogLevel.Info);
                LogManager.WriteLog("Setting Report Parameters...", LogManager.enumLogLevel.Info);

                //MachineDropReport.SetParameterValue("BatchNo", BatchNo);
                MachineDropReport.SetParameterValue("@BatchNo", BatchNo);
                MachineDropReport.SetParameterValue("@WeekCollection", WeekNo > 0 ? true : false);
                MachineDropReport.SetParameterValue("CurrencySymbol", ExtensionMethods.CurrentSiteCulture.GetCurrencySymbol());
                MachineDropReport.SetParameterValue("CopyRight", Settings.CopyRightInfo);
                MachineDropReport.SetParameterValue("Region", Settings.Region);

                IReports objReports = String.IsNullOrEmpty(_ExchangeConnectionString) ? ReportsBusinessObject.CreateInstance() : ReportsBusinessObject.CreateInstance(_ExchangeConnectionString, _TicketingConnectionString);

                List<ServerDetails> DbConnectionInfo = String.IsNullOrEmpty(_ExchangeConnectionString) ? objReports.GetDataBaseConnectionString() : objReports.GetDataBaseConnectionString(BMC.Business.CashDeskOperator.CommonUtilities.SiteConnectionString(_ExchangeConnectionString));

                ConnectionInfo myConnectionInfo = new ConnectionInfo();


                myConnectionInfo.ServerName = DbConnectionInfo[0].ServerName;  // read this information from config file.
                myConnectionInfo.DatabaseName = DbConnectionInfo[0].DataBase; // read this information from config file.
                myConnectionInfo.UserID = DbConnectionInfo[0].Username;  // read this information from config file.
                myConnectionInfo.Password = DbConnectionInfo[0].Password;  // read this information from config file.


                crDatabase = MachineDropReport.Database;
                crTables = crDatabase.Tables;

                foreach (CrystalDecisions.CrystalReports.Engine.Table crTable in crTables)
                {
                    tableLogonInfo = crTable.LogOnInfo;
                    tableLogonInfo.ConnectionInfo = myConnectionInfo;
                    crTable.ApplyLogOnInfo(tableLogonInfo);
                }


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


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

                crystalReportViewer.ReportSource = MachineDropReport;


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

                AuditReports();

                strReportName = "Machine Drop Report";
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
Ejemplo n.º 3
0
 public virtual CrystalDecisions.CrystalReports.Engine.ReportDocument CreateReport() {
     BatchWinLoss rpt = new BatchWinLoss();
     rpt.Site = this.Site;
     return rpt;
 }