/// <summary> /// Calculates the report, which is specified in the parameters table /// /// </summary> /// <returns>void</returns> public void Start(System.Data.DataTable AParameters) { TRptUserFunctionsFinance.FlushSqlCache(); FProgressID = "ReportCalculation" + Guid.NewGuid(); TProgressTracker.InitProgressTracker(FProgressID, string.Empty, -1.0m); FParameterList = new TParameterList(); FParameterList.LoadFromDataTable(AParameters); FSuccess = false; String PathStandardReports = TAppSettingsManager.GetValue("Reporting.PathStandardReports"); String PathCustomReports = TAppSettingsManager.GetValue("Reporting.PathCustomReports"); FDatacalculator = new TRptDataCalculator(DBAccess.GDBAccessObj, PathStandardReports, PathCustomReports); // setup the logging to go to the TProgressTracker TLogging.SetStatusBarProcedure(new TLogging.TStatusCallbackProcedure(WriteToStatusBar)); string session = TSession.GetSessionID(); ThreadStart myThreadStart = delegate { Run(session); }; Thread TheThread = new Thread(myThreadStart); TheThread.Name = FProgressID; TheThread.CurrentCulture = Thread.CurrentThread.CurrentCulture; TheThread.Start(); }
/// <summary> /// Calculates the report, which is specified in the parameters table /// /// </summary> /// <returns>void</returns> public void Start(System.Data.DataTable AParameters) { FProgressID = "ReportCalculation" + Guid.NewGuid(); TProgressTracker.InitProgressTracker(FProgressID, string.Empty, -1.0m); // First check whether the 'globally available' DB Connection isn't busy - we must not allow the start of a // Report Calculation when that is the case (as this would lead to a nested DB Transaction exception, // EDBTransactionBusyException). if (DBAccess.GDBAccessObj.Transaction != null) { FErrorMessage = Catalog.GetString(SharedConstants.NO_PARALLEL_EXECUTION_OF_XML_REPORTS_PREFIX + "The OpenPetra Server is currently too busy to prepare this Report. " + "Please retry once other running tasks (eg. a Report) are finished!"); TProgressTracker.FinishJob(FProgressID); FSuccess = false; // Return to the Client immediately! return; } TRptUserFunctionsFinance.FlushSqlCache(); FParameterList = new TParameterList(); FParameterList.LoadFromDataTable(AParameters); FSuccess = false; String PathStandardReports = TAppSettingsManager.GetValue("Reporting.PathStandardReports"); String PathCustomReports = TAppSettingsManager.GetValue("Reporting.PathCustomReports"); FDatacalculator = new TRptDataCalculator(DBAccess.GDBAccessObj, PathStandardReports, PathCustomReports); // setup the logging to go to the TProgressTracker TLogging.SetStatusBarProcedure(new TLogging.TStatusCallbackProcedure(WriteToStatusBar)); string session = TSession.GetSessionID(); ThreadStart myThreadStart = delegate { Run(session); }; Thread TheThread = new Thread(myThreadStart); TheThread.CurrentCulture = Thread.CurrentThread.CurrentCulture; TheThread.Name = FProgressID + "_" + UserInfo.GUserInfo.UserID + "__TReportGeneratorUIConnector.Start_Thread"; TLogging.LogAtLevel(7, TheThread.Name + " starting."); TheThread.Start(); }
/// <summary> /// Calculates the report, which is specified in the parameters table /// /// </summary> /// <returns>void</returns> public void Start(System.Data.DataTable AParameters) { TRptUserFunctionsFinance.FlushSqlCache(); this.FAsyncExecProgress = new TAsynchronousExecutionProgress(); this.FAsyncExecProgress.ProgressState = TAsyncExecProgressState.Aeps_Executing; FParameterList = new TParameterList(); FParameterList.LoadFromDataTable(AParameters); FSuccess = false; String PathStandardReports = TAppSettingsManager.GetValue("Reporting.PathStandardReports"); String PathCustomReports = TAppSettingsManager.GetValue("Reporting.PathCustomReports"); FDatacalculator = new TRptDataCalculator(DBAccess.GDBAccessObj, PathStandardReports, PathCustomReports); // setup the logging to go to the FAsyncExecProgress.ProgressInformation TLogging.SetStatusBarProcedure(new TLogging.TStatusCallbackProcedure(WriteToStatusBar)); Thread TheThread = new Thread(new ThreadStart(Run)); TheThread.CurrentCulture = Thread.CurrentThread.CurrentCulture; TheThread.Start(); }