Solved

Visual FoxPro 9 Report Printing

Posted on 2007-04-09
2
812 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

Master Your Team's Linux and Cloud Stack

Come see why top tech companies like Mailchimp and Media Temple use Linux Academy to build their employee training programs.

Question has a verified solution.

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

Suggested Solutions

This article shows how to make a Windows 7 gadget that accepts files dropped from the Windows Explorer.  It also illustrates how to give your gadget a non-rectangular shape and how to add some nifty visual effects to text displayed in a your gadget.…
If you have ever found yourself doing a repetitive action with the mouse and keyboard, and if you have even a little programming experience, there is a good chance that you can use a text editor to whip together a sort of macro to automate the proce…
This Micro Tutorial hows how you can integrate  Mac OSX to a Windows Active Directory Domain. Apple has made it easy to allow users to bind their macs to a windows domain with relative ease. The following video show how to bind OSX Mavericks to …
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…

770 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