예제 #1
0
        public virtual CrystalDecisions.CrystalReports.Engine.ReportDocument CreateReport()
        {
            Liquidation rpt = new Liquidation();

            rpt.Site = this.Site;
            return(rpt);
        }
        public void ShowLiquidationReport(DataSet dsReportsDataSet, DataSet dsSummaryReport, int BatchNo)
        {
            string sVersion = string.Empty;
            string sSiteName = string.Empty;

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

                GetVersion_SiteName(out  sVersion, out  sSiteName);

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

                TableLogOnInfo tableLogonInfo = new TableLogOnInfo();

                Liquidation LiquidationReport = new Liquidation();
                BMC.Presentation.POS.Reports.LiquidationSummary LiquidationSummaryReport = new BMC.Presentation.POS.Reports.LiquidationSummary();

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

                LiquidationReport.SetDataSource(dsReportsDataSet);
                LiquidationSummaryReport.SetDataSource(dsSummaryReport);

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

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


                LiquidationSummaryReport.SetParameterValue("@Batch_No", BatchNo);
                LiquidationSummaryReport.SetParameterValue("Currency", ExtensionMethods.CurrentSiteCulture.GetCurrencySymbol());
                LiquidationReport.SetParameterValue("@Batch_No", BatchNo);
                LiquidationReport.SetParameterValue("Currency", ExtensionMethods.CurrentSiteCulture.GetCurrencySymbol());
                IReports objReports = String.IsNullOrEmpty(_ExchangeConnectionString) ? ReportsBusinessObject.CreateInstance() : ReportsBusinessObject.CreateInstance(_ExchangeConnectionString, _TicketingConnectionString);

                
                List<ServerDetails> DbConnectionInfo = String.IsNullOrEmpty(_ExchangeConnectionString) ? objReports.GetDataBaseConnectionString() : objReports.GetDataBaseConnectionString(_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 = LiquidationReport.Database;
                crTables = crDatabase.Tables;

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

                crDatabase = LiquidationSummaryReport.Database;
                crTables = crDatabase.Tables;

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

                ReportDocument doc = LiquidationReport.OpenSubreport("LiquidationSummary.rpt");
                doc.SetDataSource(dsSummaryReport);



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


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

                
                crystalReportViewer.ReportSource = LiquidationReport;
                

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

                AuditReports();

                strReportName = "System Balancing Report";
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
예제 #3
0
 public virtual CrystalDecisions.CrystalReports.Engine.ReportDocument CreateReport() {
     Liquidation rpt = new Liquidation();
     rpt.Site = this.Site;
     return rpt;
 }