>Good.
>Why did you need the first line (nTotalpages = 0)?
It should be lnTotalpages = 0. W/o it your report will blow up on "Page x of y" field.
>PS
>The file is not temp, it's permanent *.txt file.
>You must add the line
>
delete file rep1.txt
It's up to you how you want to handle it.
--sb--