?
Solved

Visual FoxPro 9 Report Printing

Posted on 2007-04-09
2
Medium Priority
?
834 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 2000 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

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

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…
Entering time in Microsoft Access can be difficult. An input mask often bothers users more than helping them and won't catch all typing errors. This article shows how to create a textbox for 24-hour time input with full validation politely catching …
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 video, Percona Solution Engineer Dimitri Vanoverbeke discusses why you want to use at least three nodes in a database cluster. To discuss how Percona Consulting can help with your design and architecture needs for your database and infras…

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