Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Convert Excel files to PDF in VFP 9.0

Status
Not open for further replies.

taheemsoth

Programmer
Oct 4, 2006
2
0
0
US
Hello,

I use automation to create Excel files within many VFP applications. I would like to be able to convert these Excel files to PDF then open the PDF and display it for the user.

Does anyone have experience doing this? If so, what techniques/tools are you using.

Thanks, Todd
 
Start by automating xcell to select the acrobat printer , print the current file you have either opened or created.
<code from another question here to select printer>
IF EMPTY(oapp.cprinter)
oapp.cprinter = GETPRINTER()
IF !EMPTY(oapp.cprinter)
SET PRINTER TO NAME (oapp.cprinter)
ENDIF
ENDIF

Then shellexecute thefile to open it with the default acrobat reader on the machine. see thread 184-966652
 

Todd,

Just to add to White's suggestion ...

You don't need to use the Acrobat printer. Any reputable PDF printer driver would do. There are many drivers available that cost much less than the Adobe product.

The driver itself will have a setting for displaying the PDF on completion. Most drivers also let you specify the output filename programmatically.

One other important point. I'd recommend you save the current default directory to a variable just before the print, and restore it afterwards. Many PDF drivers (including Adobe's) will change the VFP default directory.

Mike



__________________________________
Mike Lewis (Edinburgh, Scotland)

My Visual FoxPro site: www.ml-consult.co.uk
 
Though this may not be a direct answer,

1) you can think of converting to xml/html whatever and display using the browser which will have its own printing facility. You can go to the extend of even having a form to open the produced file within VFP.
another way..

2) Simple create a quick report of the tables generated and create the report in pdf format.

I use the second approach for a very long time that all reports can be send to screen/printer/word/excel/pdf per choice and that is my default class in all my report forms.(I am sorry I cannot share it here.)

Just a link to something.. though it is not relevant here.. all pdf reports can be converted to excel.. using the application in this link (I am not connected to any of this... -self disclosure.)...
There could be many like this. But my trial on this was impressive. I did not buy and use, since there was no need at this stage. (The one you are asking is the other way, but may be after pdf creation, your user may want to open in excel... some day... hence this mention. )

____________________________________________
ramani - (Subramanian.G) :)
 
Thank you all for providing your feedback. I will begin exploring these options.

Mike - can you provide the names of the couple drivers that support the following?

"The driver itself will have a setting for displaying the PDF on completion. Most drivers also let you specify the output filename programmatically.
 

can you provide the names of the couple drivers ...

Well, the one I use is the Zeon driver from Docucom. I can't remember exactly how you tell it whether you want to display the PDF or specify the output filename, but I have done both those things so I know it's possible.

As with most of this type of product, you can download a free trial version, and they also have an online manual.

Mike


__________________________________
Mike Lewis (Edinburgh, Scotland)

My Visual FoxPro site: www.ml-consult.co.uk
 
NasibKalsi,

Thanks for posting that reference. However, my understanding is that this free PDF maker only works within VFP to convert VFP reports to PDF.

What Todd was looking for is a way of outputting to PDF from Excel. The PDF maker referenced in the FAQ won't do that (but correct me if I'm wrong).

Mike




__________________________________
Mike Lewis (Edinburgh, Scotland)

My Visual FoxPro site: www.ml-consult.co.uk
 
Can I suggest Foxit reader&maker - it's free. Just select it as your printer and go on.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top