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
556 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: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

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

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

Suggested Solutions

The debugging module of the VB 6 IDE can be accessed by way of the Debug menu item. That menu item can normally be found in the IDE's main menu line as shown in this picture.   There is also a companion Debug Toolbar that looks like the followin…
Background What I'm presenting in this article is the result of 2 conditions in my work area: We have a SQL Server production environment but no development or test environment; andWe have an MS Access front end using tables in SQL Server but we a…
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…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…

830 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