public virtual CrystalDecisions.CrystalReports.Engine.ReportDocument CreateReport()
        {
            batch_winloss_report rpt = new batch_winloss_report();

            rpt.Site = this.Site;
            return(rpt);
        }
        public void ShowBatchWinLossReport(int BatchNo,int WeekNo)
        {
            string sVersion = string.Empty;
            string sSiteName = string.Empty;

            try
            {
                LogManager.WriteLog("Inside ShowBatchWinLossReport method", LogManager.enumLogLevel.Info);

                GetVersion_SiteName(out  sVersion, out  sSiteName);

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

                TableLogOnInfo tableLogonInfo = new TableLogOnInfo();
                batch_winloss_report BatchWinLossReport = new batch_winloss_report();
                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);

                //BatchWinLossReport.SetParameterValue("BatchNo", BatchNo);
                BatchWinLossReport.SetParameterValue("@BatchNo", BatchNo);
                BatchWinLossReport.SetParameterValue("@WeekCollection", WeekNo > 0 ? true : false);
                BatchWinLossReport.SetParameterValue("CurrencySymbol", ExtensionMethods.CurrentSiteCulture.GetCurrencySymbol());
                BatchWinLossReport.SetParameterValue("CurrencyCulture", ExtensionMethods.CurrentCurrenyCulture);
                BatchWinLossReport.SetParameterValue("DateCulture", ExtensionMethods.CurrentDateCulture);
                BatchWinLossReport.SetParameterValue("Version", sVersion);
                //BatchWinLossReport.SetParameterValue("CopyRight", Settings.CopyRightInfo);
                BatchWinLossReport.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 = BatchWinLossReport.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 = BatchWinLossReport;


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

                AuditReports();

                strReportName = "batch winloss report";
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
 public virtual CrystalDecisions.CrystalReports.Engine.ReportDocument CreateReport() {
     batch_winloss_report rpt = new batch_winloss_report();
     rpt.Site = this.Site;
     return rpt;
 }