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!

REPORT FORM x TO FILE (Foxprow 2.6)

Status
Not open for further replies.

JPGalea

Programmer
Apr 19, 2009
20
0
0
US
I currently generate various reports that are sent to the printer which are then mailed. The doc says that I cannot use the TO FILE in Windows. Is there a way around this? I need to send a subset of the reports to a text file and ultimately get the report into the body of an email. I am trying to avoid using an attachment.
Thanks in advance,
Joe
 
Hi Dave,
When I add ASCII, I get Unrecognized phrase/keyword in command. (This is FPW 2.6)
REPORT [FORM <file> | ?]
[ENVIRONMENT]
[<scope>]
[FOR <expL1>]
[WHILE <expL2>]
[HEADING <expC>]
[NOEJECT]
[NOCONSOLE]
[NOOPTIMIZE]
[PDSETUP]

[PREVIEW]
[TO PRINTER [PROMPT] | TO FILE <file>]
[SUMMARY]
Regards,
Joe
 
What are your commands on the REPORT FORM line? Here is an example that should work:

Code:
REPORT FORM myReport TO FILE C:\MyDocu~1\myTest.TXT
Remember that FoxPro 2.6 for DOS (and maybe too the hybrid Windows version ported from DOS) uses the older DOS 8.3 file name limitations, which is why I wrote the "My Documents" folder as "MyDocu~1" above. Spaces and lengths longer than the 8.3 characters aren't allowed in the old DOS framework.
 
If it is an issue with spaces in the file name or path, then try these ideas using name expressions or macro substitution:

Code:
myDestFile = "C:\My Documents\myTest.TXT"
REPORT FORM myReport TO FILE (myDestFile)
Code:
myDestFile = "C:\My Documents\myTest.TXT"
REPORT FORM myReport TO FILE &myDestFile
 
Not sure, but you may need to include the quotes within the variable, if spaces in the file name were the problem.

Code:
myDestFile = ["C:\My Documents\myTest.TXT"]
 
The reason Dave Summers suggested including the ASCII parameter is that it will strip out the printer-specific command and control codes from the text of the report.

Current versions of Visual FoxPro (not sure about your older version) allow you to specify "ADDITIVE ASCII" if you want to send multiple reports to the same file, appending rather than overwriting.

Sorry for the multiple posts.
 
Hi All.
I'll try and answer everyone's questions.
Foxprow Help:
Include TO FILE to send character-based reports created in FoxPro for MS-DOS to the text file specified with <file2>.

My forms were all created in FPW 2.6

When I execute either of these commands:
REPORT FORM CancelOK to file Print\CancelOK.TXT
REPORT FORM CancelOK to file SYS(5)+SYS(2003)+"\PRINT\CancelOK.TXT"

I get the printer prompt. I do not have a printer installed. I normally route all output to Acrobat PDFWriter.
There is also a Print to file check box. I get this result if I do or do not check the box:
The file is created, but it is empty.
Acrobat PDFWriter creates a PDF file.
See attachment.

Regards,
Joe
 
 http://www.mediafire.com/file/mjimzxnnzuy/thread182-1603423.doc
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top