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

            rpt.Site = this.Site;
            return(rpt);
        }
        public void ShowVaultCurrentTransactionSlip(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, string TransType)
        {
            string sVersion = string.Empty;
            string sSiteName = string.Empty;

            if (TransType.ToUpper() == "FILL")
            {
                TransType = "Fill";
            }
            else if (TransType.ToUpper() == "STANDARD FILL")
            {
                TransType = "Standard Fill";
            }
            else if (TransType.ToUpper() == "BLEED")
            {
                TransType = "Bleed";
            }
            else if (TransType.ToUpper() == "POSITIVE ADJUSTMENT")
            {
                TransType = "Positive Adjustment";
            }
            else if (TransType.ToUpper() == "NEGATIVE ADJUSTMENT")
            {
                TransType = "Negative Adjustment";
            }

            try
            {
                LogManager.WriteLog("Inside Show Vault Current Transaction Slip 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();
                VaultTransactionSlip VaultBalance = new VaultTransactionSlip();

                VaultBalance.SetParameterValue("@Vault_id", Vault_Id);
                VaultBalance.SetParameterValue("VaultName", VaultName);
                VaultBalance.SetParameterValue("SiteName", sSiteName);
                VaultBalance.SetParameterValue("SiteCode", Settings.SiteCode);
                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("TransactionType", TransType);


                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 Transaction Slip Report";

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