Page 1 of 1

Error (6) deleting enhanced metefile

PostPosted: Tue Jan 31, 2006 10:22 am
by Frank Demont
Hello

I know , it is not the first time it is asked , but when i do a search , all intresting posts are in spanish , so who can give a solution in ENGLISH ?

Frank

PostPosted: Tue Jan 31, 2006 10:51 am
by Antonio Linares
Frank,

Please check that you are not calling ENDPAGE twice.

PostPosted: Tue Jan 31, 2006 11:16 am
by Frank Demont
Antonio

Can we test that calling ENDPAGE is needed or not ?

I suppose that when it is called , the EMF-file from this page is deleted , so if it not exist , ENDPAGE should not be called.

How do we know the name from the current emf-file page ?

Frank

PostPosted: Tue Jan 31, 2006 3:36 pm
by Antonio Linares
Frank,

ENDPAGE should be called for each call to PAGE:

Code: Select all  Expand view
PAGE
   ...
ENDPAGE

PostPosted: Tue Jan 31, 2006 5:26 pm
by R.F.
Frank:


Frank Demont wrote:Antonio

I suppose that when it is called , the EMF-file from this page is deleted , so if it not exist , ENDPAGE should not be called.


No way !!!!!, You have to understand a little how the FW printing system works:

When you do a PRINTER oPrn...... what are you doing is to retrieve all the printing data from the default printer driver or from another printer if you choosed FROM USER or directly used the TO "printer name" statements.

All these data (resolution, paper size, number of bins, etc) is now stored in the printer object.

When you performe a "PAGE" command, you are allocating a space IN MEMORY where you will be able of "drawing", these draws will be the oPrn:Say() or the oPrn:InchSay() or whatever. Once you have finished drawing in memory, the ENDPAGE command will write that memory space in EMF or WMF file, now you can do another new PAGE command of simply finish the printing session with and ENDPRINT command. You have to perform a PAGE...ENDPAGE operation for every single page in your report.

When you reach the ENDPRINT command, and if you specified the PREVIEW clause in the printer command, the preview window will be launched and you will be able to see all the files written by the print command, when the PREVIEW window is running, you can also send these files to the printer and once the preview window is closed all the report files are automatically erased.

If you didn't specified the PREVIEW clause, the EMFs or WMFs will be send to the printer and after that they will be erased.

So, you never have control over the EMF/WMF file erasing process.