Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Print jobs printing out of sequence
Message
De
27/07/2006 13:19:45
 
 
À
Tous
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Titre:
Print jobs printing out of sequence
Divers
Thread ID:
01140791
Message ID:
01140791
Vues:
83
For an insurance application, I have a VFP 6 application which monitors a printqueue table (via a timer) and when it spots a new record, prints a series of documents related to a specific policy. The documents are in either Word or Crystal Reports format. This application has been in place for several years and has suddenly started printing the documents out of sequence. Here is the relevant code from the timer control
SELECT * FROM frfrmque ;
  WHERE pqid = curPrintQueue.pqid AND NOT DELETED();
  ORDER BY fqid;
  INTO CURSOR curForms

IF _TALLY > 0

  CREATE CURSOR printed (printdoc C(30))  && see Note 1
  SELECT curForms

  SCAN
    IF fqid = "  2"  && See Note 2
      DO prtforms
    ENDIF

    DO CASE
      CASE fqrectype = "F"
        Thisform.PrintForm
        Thisform.PrintedForm(curforms.fqrectype,curforms.fqoutput)  && See Note 1
      CASE fqrectype = "R"
        lcType = TRIM(fqoutput)
        Thisform.Print&lcType
        Thisform.PrintedForm(curforms.fqrectype,curforms.fqoutput)  && See Note 1
      CASE fqrectype = "D"
        lcType = TRIM(fqoutput)
        Thisform.Print&lcType
        Thisform.PrintedForm(curforms.fqrectype,curforms.fqoutput)  && See Note 1
      CASE fqrectype = "S"
        Thisform.PrintSeparator
        Thisform.PrintedForm(curforms.fqrectype,curforms.fqoutput)  && See Note 1
      CASE fqrectype = "P"
        Thisform.PrintType = ALLTRIM(curForms.fqParam)
        Thisform.PrintSeparator
        Thisform.PrintedForm(curforms.fqrectype,curforms.fqoutput)  && See Note 1
    ENDCASE
  ENDSCAN

  SELECT printed  && See note 1
  LIST TO PRINT OFF NOCONSOLE
ENDIF
Note 1: The PRINTED table was added so that I can verify that the jobs were sent to the printer in the correct sequence. A new method (PrintedForm) was added to the form and is called after every print job is created. The method translates the codes in the table to English and then appends a new record to the PRINTED table. At the end of the SCAN, this table is LISTed to the printer.

Note 2: After the cover sheet is printed, this program LISTs the contents of the CurForms cursor to the pritner (while translating the codes to English)

I've been having the users compare the two new documents (from Note 1 and 2) to make sure that they are identical. In all cases, this has been true. However, when they compare it to the order in which the documents emerge from the printer, there are differences. All the documents are there, but the order is jumbled.


Everything indicates to me that the documents are being sent in the correct sequence. Can anybody think of a reason they would come out of the printer differently?

Do you think it would help to put a check at the top of my SCAN to wait until the printer queue is empty? I think I know where to find an API call which would tell me this, but I'd feel much more comfortable using code from the people here.

Any and all suggestions will be much appreciated

Thanks to all............Rich
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform