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

Fox2Word

Status
Not open for further replies.

asm338s

Programmer
Jul 16, 2001
135
US
Has anyone used this class before. I have just started to play around with it. I added the following code:

oF2W=NEWOBJECT("frx2word","msoexp")
oF2W.SaveFolder="C:\testword\"
oF2W.DOC_FileName="Wordout.doc"
oF2W.ReportHome="C:\MyApp" && Optional (new to 1.5)
nSuccess=oF2W.ReportForm("TestRep")

I get errors in fox2Word.ReportForm and Fox2Word.PlaceItem saying that Alias not found. I get the layout of the report with all the lables and textboxes and stuff, but no data. Any Ideas??

Thanks
 
HI

I do not know, if your frx2word and mine are different.
I have used one frx2word application.
But I approach it in a different way and it works ok. The syntax I use is....

DO frx2wrd.app WITH myRptFile, myWordFile

Hope this helps you :) ramani :-9
(Subramanian.G),FoxAcc, ramani_g@yahoo.com
 
I think it is the same app. So do I have to add 'msoexp' as a class in the project. And how do you specify where to save the file. I mean what I am trying to say is how the program will find where frx2word is etc. And also what would you say is the maximum size report this can handle.

Thanks. If this works it'll be awesome.
 
HI

You can have a mySendOutput.PRG as a PRG file at the end of your MAIN.PRG and call that every time you click a report button. OR better still, you can have the options in your Report Button class and drop that in your report forms.

Suitably use a DO CASE or IF conditions in the routine given below. Then this will become a standard for all your report output handling.

** If set printer options
SYS(1037)

** If option to display in screen
REPORT FORM (rptFile) PREVIEW IN SCREEN

** To send output to printer
REPORT FORM (rptFile) NOCONSOLE TO PRINTER

** To send to a text file
myFile = ;
PUTFILE("Select a file name for the report", ;
"c:\my documents","txt")
IF ALLTRIM(myFile) > " "
REPORT FORM (rptFile) NOCONSOLE ;
TO FILE (myFile) ASCII
ENDIF

** To send to a PDF file using WIN2PDF driver
SET PRINTER TO NAME "WIN2PDF"
REPORT FORM (rptFile) NOCONSOLE TO PRINTER

** To send to a word document
myFile = ;
PUTFILE("Select a file name for the report", ;
"c:\my documents","doc")
IF ALLTRIM(myFile) > " "
DO frx2wrd.app WITH rptFile, myFile
ENDIF

** To send to excell etc etc.. options

This takes care of the output issues. Also whatever other otions you want to add, you can add all of them in this routine.

Hope this helps :) ramani :-9
(Subramanian.G),FoxAcc, ramani_g@yahoo.com
 
I get an error message saying unable to find frx2word.app
I have added the class msoexp in my project. what else do I need to do? Also I think that with your approach it'll save the word document in My Documents. I believe if I don't mention that clause and just say:
DO frx2wrd.app WITH myRptFile, myWordFile It'll save it in the MyApp Directory. I would like to open it from there and then allow the user to save it in the folder of there choice.

Thanks for your help.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top