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 TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

VFP report in Word document

Status
Not open for further replies.

Toman

Technical User
Mar 30, 2004
190
CZ
Hi

Sometimes it would be handy to have a VFP report as a part of MS Word document. Does someone know how to do it. (I mean report with full formatting, not just inserting Ascii file made by REPORT .. TO FILE ASCII.)

If it is not possible, is there any other way how to produce report in a way enabling further electronic exchange without distributing VFP.

I have VFP5, but willing to switch to VFP8 soon.

Thank you in advance.
Tom
 
Just a thought..although you probably need formatted output, could you send the contents of a query which supplies data for the report to a xls file, Word knows how to handle an attached sheet from xls.
wjwjr
 
Yes, it certainly would work, but really I don't want to lose formatting.

Imagine – report with more groups, different fonts, some borders, maybe pictures. It can be done very easily with Report Designer and one don't want to do it second time in Word.

I though about sending Report to file together with formatting information, but the same printer driver is needed on second computer - not very clever.

I also though about using automation, which I'm not very familiar with.

Personally I'm afraid that I won't be able to export VFP report to Word, but my trust to Tek-Tips participants knowledge is so great, that I tried to ask.

Thank you Tom
 
Tom,

There are plenty of tools available that let you export an entire VFP report to Word. I know this isn't exactly what you want, but it might be a good starting point. You would get all the data presented as a Word document, with most of the formatting of the original report. The formatting will never be 100 percent correct, but it should be close enough in most cases.

One product that will do this is FRX2ANY (from No doubt other folk here will recommend some others.

Mike


Mike Lewis
Edinburgh, Scotland

My Visual Foxpro web site: My Crystal Reports web site:
 
Hi Mike,

I've just downloaded frx2any and xfrx demos and am starting experimenting. It is surely what I was looking for.

Only I'm afraid I'll get into troubles again with my old VFP version 5, but that's my problem.

Thank you for your tip.

Tom
 
Hi Tom,

I am very pleased with XFRX from Eqeus.com. XFRX does a good job of sending formatted Foxpro reports to Word, PDF, HTML and other assorted formats.



Bill Chambers
Chambers & Associates
 
You might consider ReportDepot for .NET - , as a tool to convert/output FRX report into PDF, RTF, HTML, XML, XML SpreadSheet, BMP, EMF, EXIF, GIF, TIFF, ICON, PNG, JPEG, and WMF
 
And of course with the VFP 9.0 beta available, you could use it's "native" output to HTML option, which Word will be prefectly happy with!

Rick
 
I use OLE to create a report as a word document. It gives more flexibility and I can create reports that are not possible using the report writer. The example below is quite trival but you can create a report using multiple data sources that aren't even related.

example code
------------

* Define variables needed in mailmerge
#DEFINE wdWindowStateMaximize 1

* Create a word letter object and make it visible and maximised
oWord = CREATEOBJECT("Word.Application")
oWord.Visible = .t.
oWord.WindowState = wdWindowStateMaximize

* Choose the correct letter template and creat the letter
jFile=gcrootdir + 'letters\client\letter1.dot'
oWord.Documents.add(jFile)

* Add the data
oWord.ActiveDocument.Bookmarks('LetDate').select
oWord.selection.text = date()

oWord.ActiveDocument.Bookmarks('FirstName').select
oWord.selection.text = alltrim(cs16.firstname)

oWord.ActiveDocument.Bookmarks('Surname').select
oWord.selection.text = alltrim(cs16.surname)

oWord.ActiveDocument.Bookmarks('Surname2').select
oWord.selection.text = alltrim(cs16.surname)

oWord.ActiveDocument.Bookmarks('Address1').select
oWord.selection.text = alltrim(cs16.address1)

oWord.ActiveDocument.Bookmarks('Address2').select
oWord.selection.text = alltrim(cs16.address2)

oWord.ActiveDocument.Bookmarks('Address3').select
oWord.selection.text = alltrim(cs16.address3)

oWord.ActiveDocument.Bookmarks('Address4').select
oWord.selection.text = alltrim(cs16.address4)

oWord.ActiveDocument.Bookmarks('Address5').select
oWord.selection.text = alltrim(cs16.address5)

oWord.ActiveDocument.Bookmarks('Postcode').select
oWord.selection.text = alltrim(cs16.postcode)

oWord.ActiveDocument.Bookmarks('title').select
oWord.selection.text = alltrim(cs16.title)

* release the object
release oWord
 
Bill,

I am very pleased with XFRX from Eqeus.com.

I have no personal experience of XFRX, but yesterday I was at the Fox UK conference, where Gordon Knott gave a presentation on it. It looked very capable and fairly easy to use.

He also mentioned that the program's author succeeded in upgrading it to work with VFP 9.0 within 48 hours of the public beta of VFP 9.0 becoming available, which is pretty good going.

Mike


Mike Lewis
Edinburgh, Scotland

My Visual Foxpro web site: My Crystal Reports web site:
 
This discussion gave me a lot. Thanks to all participants. Special thanks to mdav for inspiration.

I am about to make a great jump from my VFP5 to VFP9.

By the way – frx2any creates HTML report about ten times faster then DOC report. It is probably easier thing to do. So I had to laugh at Microsoft's selecting HTML output preferably in VFP9 and letting the others to bother about transferring reports into his native DOC format.

Right, HTML is more universal today

Tom
 
Thank Tom for bring this topic up.

MS Word document is popular or official for publication or reporting. It would be nice to insert Tables and Charts Output/Exported from Visual FoxPro Report into a MS Word document. So far I have not found a good approach for it, including VFP 9.0 public beta.

Some utilities, such as XFRX, FRX2ANY did a good job to convert VFP report to a MS Word file. However, the data are converted to Text Boxes, which is very hard for users to reformat in the Doc file. If the Detail and Summary part of the VFP report could be converted to an MS Word Table (and so Report lines to Table/Cell Borders), it would be much easier for users to edit in their final MS Word file.

I have tried the VFP 9.0 beta. The Output to HTML feature is great, but I simply could not properly save it as a Doc file. If anyone did it successfully, could you please let me know?

I would put this Report-Output-to-Word (Table-Structured, not Text Boxes) feature to VFP 9.0 wish-list. I hope we can get it in MS VFP 9.0 final product.

I have not tried the VFP 9.0 beta Chart feature yet. If anybody did it, tell us more about.

Thank you.

New member: Penglong
 
Penglong,
I wouldn't hope for any (many?) more report output types in the real VFP 9.0. The whole point of MS providing all the hooks to the report writer code, is so that third-parties can develop (and sell?) listeners that will provide virtually anything that you or anyone else wants.

In fact, because you get the source for the listeners that are provided, if you don't like how they work, you can go in and change them! (Just like we could do for many versions of most of the Wizards, Builders, GEN*.PRG/APPs, etc.)

Rick
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top