Solved

Visual FoxPro 9 Report Printing

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

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

This article shows how to make a Windows 7 gadget that extends its U/I with a flyout panel -- a window that pops out next to the gadget.  The example gadget shows several additional techniques:  How to automatically resize a gadget or flyout panel t…
A theme is a collection of property settings that allow you to define the look of pages and controls, and then apply the look consistently across pages in an application. Themes can be made up of a set of elements: skins, style sheets, images, and o…
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…
In this tutorial you'll learn about bandwidth monitoring with flows and packet sniffing with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're interested in additional methods for monitoring bandwidt…

757 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

Need Help in Real-Time?

Connect with top rated Experts

18 Experts available now in Live!

Get 1:1 Help Now