Example #1
0
        public virtual CrystalDecisions.CrystalReports.Engine.ReportDocument CreateReport()
        {
            UndeclaredVaultDrops rpt = new UndeclaredVaultDrops();

            rpt.Site = this.Site;
            return(rpt);
        }
		public void ShowOutstandingVaultReport(bool ShowCassettes)
        {
            string sVersion = string.Empty;
            string sSiteName = string.Empty;

            try
            {
                LogManager.WriteLog("Inside Show Undeclared Vault Drop Report method", LogManager.enumLogLevel.Info);

                GetVersion_SiteName(out  sVersion, out  sSiteName);

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

                TableLogOnInfo tableLogonInfo = new TableLogOnInfo();

                UndeclaredVaultDrops UndecVaultDrp = new UndeclaredVaultDrops();

                UndecVaultDrp.SetParameterValue("@GetCassette", ShowCassettes);
                UndecVaultDrp.SetParameterValue("SiteName", sSiteName);
                UndecVaultDrp.SetParameterValue("Version", sVersion);

                UndecVaultDrp.SetParameterValue("CurrencyCulture", ExtensionMethods.CurrentCurrenyCulture);
                UndecVaultDrp.SetParameterValue("CurrencySymbol", ExtensionMethods.CurrentCurrenyCulture.GetCurrencySymbol());
                UndecVaultDrp.SetParameterValue("DateCulture", ExtensionMethods.CurrentDateCulture);
                UndecVaultDrp.SetParameterValue("SiteCode", Settings.SiteCode);
                LogManager.WriteLog("Report Parameters set successfully", LogManager.enumLogLevel.Info);

                IReports objReports = ReportsBusinessObject.CreateInstance();

                List<ServerDetails> DbConnectionInfo = objReports.GetDataBaseConnectionString();

                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 = UndecVaultDrp.Database;
                crTables = crDatabase.Tables;

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


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

                crystalReportViewer.ReportSource = UndecVaultDrp;


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

                AuditReports();

                strReportName = "Undeclared Vault Drop Report";

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