Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Vfp6.0 Report Writer to Word document - FRX2Word
Message
General information
Forum:
Visual FoxPro
Category:
COM/DCOM and OLE Automation
Miscellaneous
Thread ID:
00397237
Message ID:
00397404
Views:
8
>Hi Ed,
>
>
>
>I saw this in the help file, I just wasn't sure where it went in the form?
>
>>
oF2W = NEWOBJECT("frx2word", "msoexp") && Create instance of FRX2WORD
>>oF2W.SaveFolder = "C:\My Documents\"        && directory to create .DOC in
>>oF2W.DOC_FileName = "Wordout.doc"           && name of .DOC file to create
>>nSuccess = oF2W.ReportForm("MyReport")      && Process MyReport.FRX to create document
>
>
>Does this code go in the "load" event of the form?
>

It goes at whatever point you create the output document.

>How do I go about printing the report for just the one consignor my user wants.
>

Select just the data for that one consignor into the cursor that drives the detail band of the FRX, either using SQL Select or a SET FILTER or by creating a filtered index

>Right now they enter the consignor code number in a textbox and it's used in the line, "repo form myreport for stnconsi_cons_no = "code number".
>

Assuming the report runs in the default data session,using the tables now open, add the following two lines of code before calling FRX2WORD

SET FILTER TO stnconsi_cons_no = "code number"
LOCATE


before the code I gave originally will do it brute force, you simply set a filter on the table equivalent to the FOR clause you use in your report form command now. Doing a SQL Select to create a temporary cursor would be better coding technique, but I don't know how the rest of the app or report is set up.

>How do you translate that into, nsuccess = oF2W.reportform("myreport")?
>

oF2W.ReportForm("myreport") executes the report MYREPORT.FRX and sends it's output to the Word doc named before. nsuccess contains a non-negative value if it succeeds, negative numbers are errors as listed in the docs. Read the docs; they explain this in detail. You have to learn what it does or you won't be able to use it; each time and place you use it you'll have to configure the reporting environment and FRX2WORD to run the report and create your output per your specs.
EMail: EdR@edrauh.com
"See, the sun is going down..."
"No, the horizon is moving up!"
- Firesign Theater


NT and Win2K FAQ .. cWashington WSH/ADSI/WMI site
MS WSH site ........... WSH FAQ Site
Wrox Press .............. Win32 Scripting Journal
eSolutions Services, LLC

The Surgeon General has determined that prolonged exposure to the Windows Script Host may be addictive to laboratory mice and codemonkeys
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform