Solved

Visual FoxPro 9 Report Printing

Posted on 2007-04-09
2
822 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

This article describes how to programmatically preset the "Pages per Sheet" option that's available with most printer drivers.   This setting lets you do "n-Up" printing, where two, four, or more pages are printed on each sheet of paper. If your …
Whether you've completed a degree in computer sciences or you're a self-taught programmer, writing your first lines of code in the real world is always a challenge. Here are some of the most common pitfalls for new programmers.
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…
There are cases when e.g. an IT administrator wants to have full access and view into selected mailboxes on Exchange server, directly from his own email account in Outlook or Outlook Web Access. This proves useful when for example administrator want…

726 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