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

FRX2Word error

Status
Not open for further replies.

thegame8311

Technical User
Jan 6, 2012
133
0
0
US
For some reason unknown to me, when I add the frx2word class to my project to process a report it does not do it. It returns -200 as the nVal and when i click the button to run it ti opens a file browser window, but I have no idea what it is looking for, see code below:

Code:
oFW = NEWOBJECT("frx2word","msoexp")
oFW.SaveFolder = "C:\"
oFW.DOC_FileName = "MyDoc"
nVal = oFW.ReportForm("testrpt")

MESSAGEBOX(nVal)
 
This is really a question for the makers of that product. But if I was guessing, I'd say it can't find the FRX. Give it a full path.
 
You should also find error numbers documented. Look what error -200 means.

If dan is right it might simply be "frx file not found). The browse windows also points to a file not found issue.

What's in the title bar of that browse window? Any caption or file type telling you what it looks for? That would be another pointer.

Bye, Olaf.
 
ok, well

danfreeman - I used the full path and still the same error

olafdoschke - the title of the browse window is OPEN and the file type it is looking for is dbf

i will email the creator and see what he says but any other ideas as to why this happens?
 
ok I tried also this

Code:
DO xfrx.app WITH "testrpt", "myWordFile"

but I want a specific date not all the records, would I need to modify the app?
 
What about the docs? You have a chm and it tells something about error -200.

Bye, Olaf.
 
I have never encountered that problem, but the following is the code that I used to use with FRX2Word.

It worked just fine as long as all of the 'parameters' were correct and fully pathed.

Code:
SELECT RptFile
=WriteDOC(cReportForm, cFinalDOC)
< and so on... >


* --------------------------------
FUNCTION WriteDOC
PARAMETERS cFRXFile, cDOCFile

cDestFileDir = JUSTPATH(cDOCFile)
cFRXFileDir = JUSTPATH(cFRXFile)

oF2W = NEWOBJECT("frx2word","msoexp")
oF2W.SaveFolder = ADDBS(cDestFileDir)
oF2W.DOC_FileName = cDOCFile
oF2W.ReportHome = cFRXFileDir
nSuccess = oF2W.ReportForm(cFRXFile)

oF2W = .NULL.
RELEASE oF2W

RETURN nSuccess

Good Luck,
JRB-Bldr
 
>the title of the browse window is OPEN and the file type it is looking for is dbf

Have you treid starting the FRX on it's own? Simply via double click and running preview? Is the FRX perhaps missing a dbf file, and not FRX2WORD?

Bye, Olaf.
 
the title of the browse window is OPEN and the file type it is looking for is dbf

Of course it is looking for a DBF (or Cursor) in order to print the VFP Report Form.

Despite your using FRX2Word, you are still 'printing' (even if it 'prints' out to a DOC file) a VFP Report Form (the FRX part) and that will need one or more data records.

You note in the code that was working for me, I had to
SELECT RptFile
BEFORE calling the function which utilizes FRX2Word.

Also make sure within your VFP Report Form that you have not definitively declared a table's field as the Expression of one of the Form's objects.
For example: If you had happened to set a Form's Textbox Expression to ThisTable.ThisField then the form will be looking specifically for the data table 'ThisTable' to be available to it.

Olaf's suggestion is a good one - of inserting a
REPORT FORM MyReport PREVIEW
IMMEDIATELY BEFORE you launch into the FRX2Word routine (for debug purposes), to see if there is anything wrong in the Report Form's ability to work on its own.

Good Luck,
JRB-Bldr
 
jrbbldr - The report is already created though, what would be the need of the stuff at the top, can't I just use the writedoc function?

OlafDoschke - the frx starts without issue, and it reads from the databases it refers to with the fields

Now i did get a response from the author of the program so I will try his way, go from there
 
The report is already created though, what would be the need of the stuff at the top, can't I just use the writedoc function

NO.

FRX2Word creates/writes the VFP Report to the specified DOC file.

Good Luck,
JRB-Bldr




 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top