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

Pass data from report to MS word 3

Status
Not open for further replies.

Guest_imported

New member
Jan 1, 1970
0
I would like to ask how to pass all the data/information from a report to
MS word? I need to send the report to others through email after I have printed
it. Thanks.
 
Hi Ryan,

As Chris mentioned, Frx2Word is a VFP class that provides this functionality. One note: it's great for simple reports (1-2 pages); however is somewhat slow producing larger reports.

Other alternatives include (but not limited to):

REPORT FORM...TO FILE ASCII if cosmetics is not an issue.

Purchase a PDF print drive and email the report in .PDF format.

Use Word to do a Mail Merge. There are plenty of examples in the MSDN.

Use Crystal Reports as your report engine. It has a sweet export to Word document option. Jon Hawkins

The World Is Headed For Mutiny,
When All We Want Is Unity. - Creed
 
Thanks ChrisRChamberlain,I downloaded frx2word successfully, but i am not that familiar with 'classes', and i have a hard time integrating
it with the REPORT FORM, how can i use it. thanks
 
Hello

1. Add the class to your project.
2. In the Click event of the button supposed to export the report to Word document, write the following:

oDocRep = NEWOBJECT("frx2word","msoexp")
oDocRep.SaveToFolder="C:\My Documents"
oDocRep.Doc_FileName = "Output.doc"
nSuccess = oDocRep.ReportForm("frx_name")

(the code above comes from the class documentation).


It works. You have to install Word to get the job done.

Hope this helps Grigore Dolghin
Class Software
Bucharest, Romania
 
I really don't think I deserve the star. I've quoted the docs :). Thank you, anyway!

Grigore Dolghin
Class Software
Bucharest, Romania
 
GrigoreDolghin,

This is what i did, I created simple form with just one
command button, then I added the :
oDocRep = NEWOBJECT("frx2word","msoexp")
oDocRep.SaveToFolder="C:\My Documents"
oDocRep.Doc_FileName = "Output.doc"
nSuccess = oDocRep.ReportForm("frx_name")

I added also the class to the form.
but when i ran the form, it can't found 'newobject'
program, and other procedure.
Additional help please---thanks
 
Whathandle,

IIRC, the NewObject function was introduced with version 6. So if you are running an earlier version, you'll need to use the following:

SET CLASSLIB TO msoexp ADDITIVE
oDocRep = CreateObject("frx2word")
oDocRep.SaveToFolder="C:\My Documents"
oDocRep.Doc_FileName = "Output.doc"
nSuccess = oDocRep.ReportForm("frx_name")

Also, be sure frx_name is a valid report name. Jon Hawkins

The World Is Headed For Mutiny,
When All We Want Is Unity. - Creed
 
Thanks Jon Hawkins,

Yes you are right, I was using VFP 5.0, then I installed
VFP 6.0, but then again i had some errors, can't find
some procedures : justpath.prg,addbs.prg & F2W_CDR

is this also included on the new version?
 
WhatHandle

JustPath() and Addbs() are functions in FoxTools.fll

SET LIBRARY TO [d]:\path\foxtools ADDITIVE will give you access.

Please advise the context of F2W_CDR

Chris :)
 
As Chris said, in VFP5, those functions were provided in foxtools. In VFP6(as you stated you upgraded), those functions have been incorporated into the mainstream language.

See:
INFO: FoxTools Functions That Have Been Incorporated Into VFP 6
Jon Hawkins

The World Is Headed For Mutiny,
When All We Want Is Unity. - Creed
 
With your help, I think I'm on the right track.
Only i have this error 'Class definition SESSION is not found'; then followed by some more errors which i think are inherited from not finding 'Session'. More help please. thanks.

By the way this is the command inside the class which gives error :

f2w_osession=newobject('Session')
 
Jon Hawkins & Chris Chamberlain,

Thank you guys! I did it... I was able to convert
my FRX to DOC file, and of course its because of
your help... Thanks also to this forum, it is really
a great help...'hope you won't stop helping Foxpro
users like me..
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top