Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Output a report in PDF format
Message
From
13/04/2010 03:32:31
 
 
To
13/04/2010 03:06:38
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Environment versions
Visual FoxPro:
VFP 9 SP2
OS:
Windows Server 2003
Network:
Windows 2003 Server
Database:
Visual FoxPro
Application:
Desktop
Miscellaneous
Thread ID:
01455338
Message ID:
01459875
Views:
71
>Hi Srdjan
>
>I'm getting an error when I try to open the PDF file: "There was an error opening the document. The file is damaged and could not be repaired!" After investigating I found that this happens when the user previews the report ("report form tmprpt to printer prompt preview") and selects to print the report. I call your class after the preview report command and then it creates the PDF, but you can see the size is to small (1KB instead of 138KB) and if you try to open it, the above mentioned error is displayed.
>
>Is there another command that I must include? If I preview the report and just close the preview, without printing, the file is created without errors and it can open. So, I don't think it is the preview, but rather the code that takes place when the user selects a printer. After the printer is selected the print preview screen is automatically closed.

Hi Irene

That is little bit strange.
You essentially are running report twice this way. Try restoring main alias record pointer after you called FRX for printing purposes only. previous FRX process/task have to be effectively completed and main alias restored before you call next FRX process through RS.

Or you can put things other way arround; Create PDF first using RS, and then shoot ordinary FRX printout.
After that you can use or disregard resulting PDF depend on your need.

BTW you might want to have a look at RS Preview facility, which is also able to produce PDF directly from within preview.
When PDF is created via RS Preview by user action, resulting PDF file name is passed to hook method 'WithFile' where you can consume it any way you wish. That hook method should be customised inside RS subclass which you already have
somewhere inside your code. (If you folowed up setup instructions)

HTH
Sergio
*****************
Srdjan Djordjevic
Limassol, Cyprus

Free Reporting Framework for VFP9 ;
www.Report-Sculptor.Com
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform