示例#1
0
        /// <summary>
        /// this is where all the calculations take place
        /// </summary>
        /// <returns>
        /// true if the report was successfully generated
        /// </returns>
        public Boolean GenerateResultRemoteClient()
        {
            Boolean ReturnValue;
            Thread  ProgressCheckThread;

            ReturnValue          = false;
            FReportingGenerator  = TRemote.MReporting.UIConnectors.ReportGenerator();
            FKeepUpProgressCheck = true;

            try
            {
                this.Results = new TResultList();
                FReportingGenerator.Start(this.Parameters.ToDataTable());
                ProgressCheckThread = new Thread(new ThreadStart(AsyncProgressCheckThread));
                ProgressCheckThread.Start();
            }
            catch (Exception e)
            {
                TLogging.Log(e.Message);

                // Release the server object
                FReportingGenerator = null;

                return(false);
            }

            // todo: allow canceling of the calculation of a report
            while (FKeepUpProgressCheck)
            {
                Thread.Sleep(500);
            }

            ReturnValue = FReportingGenerator.GetSuccess();

            // Do not release the server object, we still might want to send an email...
            // FReportingGenerator = null;

            if (ReturnValue)
            {
                if (FCalculatesExtract)
                {
                    TLogging.Log("Extract calculation finished. Look for extract '" +
                                 Parameters.Get("param_extract_name").ToString() +
                                 "' in Extract Master List.", TLoggingType.ToStatusBar);

                    TFormsMessage BroadcastMessage = new TFormsMessage(TFormsMessageClassEnum.mcExtractCreated);
                    BroadcastMessage.SetMessageDataName(Parameters.Get("param_extract_name").ToString());
                    TFormsList.GFormsList.BroadcastFormMessage(BroadcastMessage);
                }
                else
                {
                    TLogging.Log("Report calculation finished.", TLoggingType.ToStatusBar);
                }
            }

            return(ReturnValue);
        }
示例#2
0
        /// <summary>
        /// this is where all the calculations take place
        /// </summary>
        /// <returns>true if the report was successfully generated
        /// </returns>
        public Boolean GenerateResultRemoteClient()
        {
            Boolean ReturnValue;
            Thread ProgressCheckThread;

            ReturnValue = false;
            FReportingGenerator = TRemote.MReporting.UIConnectors.ReportGenerator();
            FKeepUpProgressCheck = true;

            // Register Object with the TEnsureKeepAlive Class so that it doesn't get GC'd
            TEnsureKeepAlive.Register(FReportingGenerator);
            try
            {
                this.Results = new TResultList();
                FReportingGenerator.Start(this.Parameters.ToDataTable());
                ProgressCheckThread = new Thread(new ThreadStart(AsyncProgressCheckThread));
                ProgressCheckThread.Start();
            }
            catch (Exception e)
            {
                TLogging.Log(e.Message);

                // UnRegister Object from the TEnsureKeepAlive Class so that the Object can get GC'd on the PetraServer
                TEnsureKeepAlive.UnRegister(FReportingGenerator);

                return false;
            }

            // todo: allow canceling of the calculation of a report
            while (FKeepUpProgressCheck)
            {
                Thread.Sleep(500);
            }

            ReturnValue = FReportingGenerator.GetSuccess();

            // UnRegister Object from the TEnsureKeepAlive Class so that the Object can get GC'd on the PetraServer
            TEnsureKeepAlive.UnRegister(FReportingGenerator);

            if (ReturnValue)
            {
                if (FCalculatesExtract)
                {
                    TLogging.Log("Extract calculation finished. Look for extract '" +
                        Parameters.Get("param_extract_name").ToString() +
                        "' in Extract Master List.", TLoggingType.ToStatusBar);

                    TFormsMessage BroadcastMessage = new TFormsMessage(TFormsMessageClassEnum.mcExtractCreated);

                    BroadcastMessage.SetMessageDataName(Parameters.Get("param_extract_name").ToString());

                    TFormsList.GFormsList.BroadcastFormMessage(BroadcastMessage);
                }
                else
                {
                    TLogging.Log("Report calculation finished.", TLoggingType.ToStatusBar);
                }
            }

            return ReturnValue;
        }
示例#3
0
        /// <summary>
        /// this is where all the calculations take place
        /// </summary>
        /// <returns>
        /// true if the report was successfully generated
        /// </returns>
        public Boolean GenerateResultRemoteClient()
        {
            Boolean ReturnValue;
            Thread ProgressCheckThread;

            ReturnValue = false;
            FReportingGenerator = TRemote.MReporting.UIConnectors.ReportGenerator();
            FKeepUpProgressCheck = true;

            try
            {
                this.Results = new TResultList();
                FReportingGenerator.Start(this.Parameters.ToDataTable());
                ProgressCheckThread = new Thread(new ThreadStart(AsyncProgressCheckThread));
                ProgressCheckThread.Start();
            }
            catch (Exception e)
            {
                TLogging.Log(e.Message);

                // Release the server object
                FReportingGenerator = null;

                return false;
            }

            // todo: allow canceling of the calculation of a report
            while (FKeepUpProgressCheck)
            {
                Thread.Sleep(500);
            }

            ReturnValue = FReportingGenerator.GetSuccess();

            // Do not release the server object, we still might want to send an email...
            // FReportingGenerator = null;

            if (ReturnValue)
            {
                if (FCalculatesExtract)
                {
                    TLogging.Log("Extract calculation finished. Look for extract '" +
                        Parameters.Get("param_extract_name").ToString() +
                        "' in Extract Master List.", TLoggingType.ToStatusBar);

                    TFormsMessage BroadcastMessage = new TFormsMessage(TFormsMessageClassEnum.mcExtractCreated);
                    BroadcastMessage.SetMessageDataName(Parameters.Get("param_extract_name").ToString());
                    TFormsList.GFormsList.BroadcastFormMessage(BroadcastMessage);
                }
                else
                {
                    TLogging.Log("Report calculation finished.", TLoggingType.ToStatusBar);
                }
            }

            return ReturnValue;
        }
示例#4
0
        /// <summary>
        /// this is where all the calculations take place
        /// </summary>
        /// <returns>true if the report was successfully generated
        /// </returns>
        public Boolean GenerateResultRemoteClient()
        {
            Boolean ReturnValue;
            Thread  ProgressCheckThread;

            ReturnValue          = false;
            FReportingGenerator  = TRemote.MReporting.UIConnectors.ReportGenerator();
            FKeepUpProgressCheck = true;

            // Register Object with the TEnsureKeepAlive Class so that it doesn't get GC'd
            TEnsureKeepAlive.Register(FReportingGenerator);
            try
            {
                this.Results = new TResultList();
                FReportingGenerator.Start(this.Parameters.ToDataTable());
                ProgressCheckThread = new Thread(new ThreadStart(AsyncProgressCheckThread));
                ProgressCheckThread.Start();
            }
            catch (Exception e)
            {
                TLogging.Log(e.Message);

                // UnRegister Object from the TEnsureKeepAlive Class so that the Object can get GC'd on the PetraServer
                TEnsureKeepAlive.UnRegister(FReportingGenerator);

                return(false);
            }

            // todo: allow canceling of the calculation of a report
            while (FKeepUpProgressCheck)
            {
                Thread.Sleep(500);
            }

            ReturnValue = FReportingGenerator.GetSuccess();

            // UnRegister Object from the TEnsureKeepAlive Class so that the Object can get GC'd on the PetraServer
            TEnsureKeepAlive.UnRegister(FReportingGenerator);

            if (ReturnValue)
            {
                if (FCalculatesExtract)
                {
                    TLogging.Log("Extract calculation finished. Look for extract '" +
                                 Parameters.Get("param_extract_name").ToString() +
                                 "' in Extract Master List.", TLoggingType.ToStatusBar);

                    TFormsMessage BroadcastMessage = new TFormsMessage(TFormsMessageClassEnum.mcExtractCreated);

                    BroadcastMessage.SetMessageDataName(Parameters.Get("param_extract_name").ToString());

                    TFormsList.GFormsList.BroadcastFormMessage(BroadcastMessage);
                }
                else
                {
                    TLogging.Log("Report calculation finished.", TLoggingType.ToStatusBar);
                }
            }

            return(ReturnValue);
        }