Solved

Visual FoxPro 9 Report Printing

Posted on 2007-04-09
2
815 Views
Last Modified: 2007-12-19
I am using Visual Foxpro 9, developing in Vista but testing in Vista and XP SP2. Vista isn't the issue, because I was developing on the XP machine prior to getting Vista and experiencing the same issues. I am having printing issues.

I am trying to automate printing. Regardless of what I do with "Set Printer to Name" when I run "Report Form X to Printer" It always prints to the Windows Default Printer in Vista and XP. I may need to use the new object-assisted printing, but I can't find any good doumentation.

To elaborate on what I am doing... A form pops up with options about what test results they want to print. They have a choice between print preview or print to a specific printer that they choose. In addition, They have an option to email the doctor (tied to the test) the results. The email checkbox triggers an email process that starts by printing the generated form to the "Adobe PDF" Driver. VFP will not send the report to that driver, it always goes to the Windows Default Printer. It's not an issue with the adobe driver either because I tried sending it to a secondary local printer and it still goes the Windows Default Printer.

Any help would be great, Thanks in advance
0
Comment
Question by:larryelias
2 Comments
 
LVL 8

Accepted Solution

by:
mikegagnon earned 500 total points
ID: 18876116
1.Make sure your report environment does not contain the information about any printers. Modify your report and make sure that the Report->Printer environment is unselected.
2. If all else fails, change the default windows printer to the printer you want prior to sending your report to print, and change it back after. You use Windows Scripting or API calls for this. Here is the scripting version
oNet = CreateObject('WScript.Network')
oNet.SetDefaultPrinter('\\ServerName\PrinterName')


0
 

Author Comment

by:larryelias
ID: 18876397
Thanks so much, you have no idea how long I've been messing with this. I had no idea that printer environment option was there. I was trying to write scripts to clear those values from the table behind the report. Thanks again
0

Featured Post

MIM Survival Guide for Service Desk Managers

Major incidents can send mastered service desk processes into disorder. Systems and tools produce the data needed to resolve these incidents, but your challenge is getting that information to the right people fast. Check out the Survival Guide and begin bringing order to chaos.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article describes a technique for converting RTF (Rich Text Format) data to HTML and provides C++ source that does it all in just a few lines of code. Although RTF is coming to be considered a "legacy" format, it is still in common use... po…
zlib is a free compression library (a DLL) on which the popular gzip utility is built.  In this article, we'll see how to use the zlib functions to compress and decompress data in memory; that is, without needing to use a temporary file.  We'll be c…
This is Part 3 in a 3-part series on Experts Exchange to discuss error handling in VBA code written for Excel. Part 1 of this series discussed basic error handling code using VBA. http://www.experts-exchange.com/videos/1478/Excel-Error-Handlin…
Nobody understands Phishing better than an anti-spam company. That’s why we are providing Phishing Awareness Training to our customers. According to a report by Verizon, only 3% of targeted users report malicious emails to management. With compan…

821 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question