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

            rpt.Site = this.Site;
            return(rpt);
        }
        public void ShowVaultCurrentDropSlip(int Vault_Id, string VaultName, string Serial_No, string Manufacturer_Name, string Type_Prefix, string LoginUser,
                                                        DateTime CreatedDate, bool IsWebServiceEnabled, decimal FillAmount, decimal TotalAmountOnFill,
                                                        decimal CurrentBalance, bool _isfinaldrop)
        {
            string sVersion = string.Empty;
            string sSiteName = string.Empty;

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

                GetVersion_SiteName(out  sVersion, out  sSiteName);

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

                TableLogOnInfo tableLogonInfo = new TableLogOnInfo();
                VaultDropTransactionSlip VaultBalance = new VaultDropTransactionSlip();

                string DropType = string.Empty;

                if (_isfinaldrop)
                    DropType = "Final Drop";
                else
                    DropType = "Standard Drop";

                VaultBalance.SetParameterValue("@Vault_id", Vault_Id);
                VaultBalance.SetParameterValue("VaultName", VaultName);
                VaultBalance.SetParameterValue("SiteName", sSiteName);
                VaultBalance.SetParameterValue("SerialNo", Serial_No);
                VaultBalance.SetParameterValue("Type_Prefix", Type_Prefix);
                VaultBalance.SetParameterValue("Manufacturer_Name", Manufacturer_Name);
                VaultBalance.SetParameterValue("LoginUser", LoginUser);
                VaultBalance.SetParameterValue("CreatedDate", CreatedDate);
                VaultBalance.SetParameterValue("IsWebServiceEnabled", IsWebServiceEnabled);
                VaultBalance.SetParameterValue("FillAmount", FillAmount);
                VaultBalance.SetParameterValue("TotalAmountOnFill", TotalAmountOnFill);
                VaultBalance.SetParameterValue("CurrentBalance", CurrentBalance);
                VaultBalance.SetParameterValue("Version", sVersion);
                VaultBalance.SetParameterValue("CurrencyCulture", ExtensionMethods.CurrentCurrenyCulture);
                VaultBalance.SetParameterValue("CurrencySymbol", ExtensionMethods.CurrentCurrenyCulture.GetCurrencySymbol());
                VaultBalance.SetParameterValue("DateCulture", ExtensionMethods.CurrentDateCulture);
                VaultBalance.SetParameterValue("DropType", DropType);
                VaultBalance.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 = VaultBalance.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 = VaultBalance;
                LogManager.WriteLog("Report Source set successfully", LogManager.enumLogLevel.Info);
                AuditReports();
                strReportName = "Vault Drop Transaction Slip Report";
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }       
 public virtual CrystalDecisions.CrystalReports.Engine.ReportDocument CreateReport() {
     VaultDropTransactionSlip rpt = new VaultDropTransactionSlip();
     rpt.Site = this.Site;
     return rpt;
 }