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

Faxing and VFP 2

Status
Not open for further replies.

chpicker

Programmer
Apr 10, 2001
1,316
Has anyone ever tried to fax a report from VFP? The simple way, of course, is to set the current printer to be the fax and print it out. I have done this...that's not my question.

My question is: The faxing I want to do is actually 3 reports that I would like to send out as a single fax. Can anyone suggest how I might be able to do this? Is there a way to print to a file, appending the file with each print, then sending the "print" file to the fax/printer with all of the reports combined as a single print job?
 
I don't think you can do what you want directly. I would send the reports to 3 different text files, then bring them sequentially into a cursor using APPEND FROM. Then "print" this cursor.

Jim
 
That wouldn't work...the first 2 use the same report form, so that might work, but the third item is a completely different format.

What I have is a scheduling program for drivers. You start with a list of drivers and a list of trips for the day, then decide who will take which trips. Once you have all of them matched up, the program then generates 2 or 3 files: a spreadsheet-like overview of the entire schedule, which can be either 1 or 2 separate reports, and an itemized list of the details for each trip.

Once everything is all put together, we print them out and fax them to the drivers. I would much rather skip the printout step...but don't want to end up sending each driver 2 or 3 separate faxes to get the job done. Any suggestions?
 
I would print the 3 reports to 3 different text files.
Create a database with one memo field.
Append the 3 reports into the memo field.
Export the memo field back out as one text file or to the fax print driver.
The press on with the fax operation.

David W. Grewe
Dave@internationalbid.com
ICQ VFP ActiveList #46145644
 
It doesn't matter how different the reports are. Once you send them to a file they're just text files - all in the same format.

Jim
 
Ok...I tried the idea of printing to text files. I printed each of the reports TO FILE instead of TO PRINTER, and ended up with 3 .txt files that, as expected, look like garbage when viewed with a text editor.

However, at this point I am stuck. How do you import them back into FoxPro? I tried creating a cursor with a single memo field and using APPEND FROM, but no matter what parameters I tried I always either got "No fields found to process" or "Not a table". Also, does anyone know how to actually PRINT a file that has been created this way?
 
Use the ASCII keyword in your REPORT FORM command. This way the files will be legible in a text editor.

Then:

CREATE CURSOR cc (x c(200))
APPEND FROM print1.txt TYPE SDF
APPEND FROM print2.txt TYPE SDF
APPEND FROM print3.txt TYPE SDF
SET HEADINGS OFF
DISPLAY ALL OFF TO PRINT

Jim
 
Hi ChPicker,

This functionality depends on what fax client you are using. Typically, the fax software exposes a COM/ActiveX object that you instantiate and any print jobs sent to that print driver are appended into the fax job until you tell the object to send the transmission. FI,

oFaxObject=CreateObject('MyFaxSoftware.MyFaxObject')
SET PRINTER TO NAME 'MyFaxPrinter Name'
REPORT FORM MyReport TO PRINTER
REPORT FORM MyReport2 TO PRINTER
oFaxObject.FaxNumber='5555555'
oFaxObject.Send

In regards to the comments above, if you do decide to concatenate the reports, try something like:

_ASCIICOLS=200
REPORT FORM MyReport TO FILE 'MyReport.txt' ASCII
REPORT FORM MyReport2 TO FILE 'MyReport2.txt' ASCII
SET PRINTER TO NAME 'MyFaxPrinter Name'
SET PRINTER ON
? FILETOSTR('MyReport.txt') + FILETOSTR('MyReport2.txt')
SET PRINTER OFF
SET PRINTER TO Jon Hawkins
 
jimstarr, thanks for the coding example. That's exactly what I was looking for. :eek:)

jonscott8...your example throws me into a new direction that would make this whole project a heck of a lot easier. I hadn't thought of automated fax software, I was simply using the Windows built-in Fax print driver. Can you give me an example of a fax program that supports automation?
 
Bitware. Usually, it comes with the modems.

It will install a printer, and the code posted by Jon will work perfectly.

Hope this helps. Grigore Dolghin
Class Software
Bucharest, Romania
 
Symantec's WinFax Pro is one of the most commonly used clients. IIRC, the biggest downside is that it requires a user license for each machine($119 a pop). Although, some developers claim moderate success dedicating one machine on the network as a fax server.

I've successfully used a product called FaxMan Jr. by Data Techniques, Inc found at Its idealistic for deployed applications where a dedicated fax server isnt feasible. Cost of $395 w/ 10K runtime licenses annually, IIRC.

There are several others on the market. You might wanna explore for others. Jon Hawkins
 
Can anyone fill in the specifics for Winfax in the code:

oFaxObject=CreateObject('MyFaxSoftware.MyFaxObject')
SET PRINTER TO NAME 'MyFaxPrinter Name'
REPORT FORM MyReport TO PRINTER
REPORT FORM MyReport2 TO PRINTER
oFaxObject.FaxNumber='5555555'
oFaxObject.Send

Do I need to do anything else but add this code to my program in order to send faxes?
I am replacing DOS FoxPro 2.6 code run from a .bat file that sent faxes via DataFax software to our vendors overnight. We have over 700 vendors and store the fax numbers in our vendor table. I can re-use most of the code to create the documents, and hopefully just change the section that would send each doc to the queue.
I'm in urgent need of this info, since the Novel server housing the DataFax is migrating to NT within a few weeks.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top