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
524 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
  • 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:Herman D'Hondt
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

Threat Intelligence Starter Resources

Integrating threat intelligence can be challenging, and not all companies are ready. These resources can help you build awareness and prepare for defense.

Join & Write a Comment

Introduction While answering a recent question about filtering a custom class collection, I realized that this could be accomplished with very little code by using the ScriptControl (SC) library.  This article will introduce you to the SC library a…
Have you ever wanted to restrict the users input in a textbox to numbers, and while doing that make sure that they can't 'cheat' by pasting in non-numeric text? Of course you can do that with code you write yourself but it's tedious and error-prone …
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…

758 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

21 Experts available now in Live!

Get 1:1 Help Now