Пример #1
0
        public virtual CrystalDecisions.CrystalReports.Engine.ReportDocument CreateReport()
        {
            VaultCurrentBalanceSlip rpt = new VaultCurrentBalanceSlip();

            rpt.Site = this.Site;
            return(rpt);
        }
 public virtual CrystalDecisions.CrystalReports.Engine.ReportDocument CreateReport() {
     VaultCurrentBalanceSlip rpt = new VaultCurrentBalanceSlip();
     rpt.Site = this.Site;
     return rpt;
 }
        public void ShowVaultCurrentBalanceSlip(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 sVersion = string.Empty;
            string sSiteName = string.Empty;

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

            }
            catch (Exception ex)
            {
                throw ex;
            }
        }