Solved

Printing a Crystal Report printer in VB6 to a different printer, but so that it actually prints and doesn't hang.

Posted on 2011-03-09
6
569 Views
Last Modified: 2012-05-11
I have a vb6 app using Crystal Reports 10.  I can change the printer in code using:
    CrRpt.SelectPrinter PrinterDriver, PrinterName, PrinterPort
This works fine for most printers, but not all.  For example, selecting Brother HL-5140 (in my code using VB PrinterDialog control), my code then sets the printer (code line above) and tries to print the crystal report later.  The printer status lights up amber for several seconds, then turns back to green and never prints.  If I set the same printer as the windows default printer it works fine.  My code works for some printers but not all (Ricoh is a problem).  I can print to the Brother HL-5140 just fine if it is the Windows Default printer.  Any ideas?
0
Comment
Question by:Willbros
[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
  • 2
6 Comments
 
LVL 100

Expert Comment

by:mlmcc
ID: 35087094
What printer was the report built against?

mlmcc
0
 

Accepted Solution

by:
Willbros earned 0 total points
ID: 35112733
The CR report in questjion was built against the Brother HL-5140 printer.  I just went and change that CR report to 'No Printer', saved it, set the Windows Default to a different printer, ran my application, changed in my software's Printer Setup to use the Brother, and WALLA, it printed!  I then tried to print another report that was still saved as 'built against the Brother', and DOH, it didn't print.  Changed the 2nd CR report to NOT use a pritner, and WALLA, it now works.  This now works on my machine/printer setup, but will setting 'No Printer' in CR dev mode take care of other clients of my software where they use different printers entirely?

Is this a known issue with CR?  I'm using Version 10, SP3.  I had issues with SPs after 3.
0
 
LVL 100

Expert Comment

by:mlmcc
ID: 35113374
I don't know.  I had just the opposite experience.  I built/revised reports on one of my machines that didn't have a printer driver loaded since I didn't have a printer.

WHen deployed to the user's machine, they couldn't print.  I checked the reports and they all had the NO PRINTER set.  When I installed a printer driver (I used the users driver so they could have a color option) and then they could print.
All I did was reopen the reports and click the NO PRINTER off.  I don't know if it is because I had no printer loaded and loading one then saving with the NO PRINTER option on if it would have worked or not.

mlmcc
0
 

Author Comment

by:Willbros
ID: 35140958
I think you have to change your code to this:

If prn1.fails then
pran b
else
me.spit.others
end if
0
 
LVL 38

Expert Comment

by:hdhondt
ID: 35399237
This question has been classified as abandoned and is being closed as part of the Cleanup Program. See my comment at the end of the question for more details.
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

When trying to find the cause of a problem in VBA or VB6 it's often valuable to know what procedures were executed prior to the error. You can use the Call Stack for that but it is often inadequate because it may show procedures you aren't intereste…
Printers have changed substantially in the last 30 or so years, not just in technical capabilities but in cost and usage as well.  Printers were originally used for interfacing with the operator, not necessarily for printing copy or pictures. In …
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…

739 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