ProcessResultFiles (process generated output files)

Top  Previous  Next

 

ProcessResultFiles (OutputFileQueue ), VIRTUAL

The ProcessResultFiles virtual method is provided as an entry point to process the contents of the OutputFileQueue before the queue is freed and the report is either saved to disk in one of several formats, or sent to the printer.

Member of: ReportManager

Implementation:

The ProcessResultFiles method is called by the ReportManager’s PrintReport method. By default, the method returns Level:Benign. If any other value is returned, the report’s printing will be aborted.

Return Data Type:     BYTE

Example:

ReportManager.PrintReport         PROCEDURE()

Rt      BYTE

lIndex  SHORT

 CODE

! Used select the target at the beginning if this is not a standard report

  IF NOT SELF.ReportTarget &= NULL THEN

   IF RECORDS(SELF.PreviewQueue) THEN

    IF SELF.ReportTarget.SupportResultQueue()=True THEN

     SELF.ReportTarget.SetResultQueue(SELF.OutputFileQueue)

    END

! The false parameter means that the AskProperties must ask for a name

! only if the target name is blank

    IF SELF.ReportTarget.AskProperties(False)=Level:Benign THEN

     SELF.WMFParser.Init(SELF.PreviewQueue, SELF.ReportTarget, SELF.Errors)

     IF SELF.WMFParser.GenerateReport()=Level:Benign THEN

      IF SELF.ReportTarget.SupportResultQueue()=True THEN

       Rt = SELF.ProcessResultFiles(SELF.OutputFileQueue) !after generating

      END

     END

    END

   END

  ELSE

   FREE(SELF.OutputFileQueue)

   LOOP lIndex=1 TO RECORDS(SELF.PreviewQueue)

    GET(SELF.PreviewQueue,lIndex)

    IF NOT ERRORCODE() THEN

     SELF.OutputFileQueue.FileName = SELF.PreviewQueue.FileName

     ADD(SELF.OutputFileQueue)

    END

   END

   !prior to flushing to printer

   IF SELF.ProcessResultFiles(SELF.OutputFileQueue)=Level:Benign THEN

    SELF.Report{PROP:FlushPreview} = True

   ELSE

    SELF.Report{PROP:FlushPreview} = FALSE

   END

  END