473,388 Members | 1,198 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,388 software developers and data experts.

Switch reports if print can't print in color

489 256MB
I know this probably sounds like a dumb question but here goes. I have a report the high lights different areas of the report in colors. There is a legend at the top of the report that explains what each color represents. The problem is not all users have color printers and when the report prints some of the color areas are impossible to read. What I would like to do is be able to identify the users printer and if it has color capabilities of printing color then use the color report and if not switch to a version of the report that doesn't have the color shading. Is this possible????

Thanks for your help as always.
Nov 18 '11 #1

✓ answered by ADezii

It is a relatively simple matter to tell if a Printer has Color Capabilities, case in point:
Expand|Select|Wrap|Line Numbers
  1. Dim prn As Printer
  2.  
  3. For Each prn In Application.Printers
  4.   With prn
  5.     Debug.Print .DeviceName & ": " & IIf(.ColorMode = acPRCMColor, "[CAN]", "cannot") & _
  6.                               " Print in Color"
  7.   End With
  8. Next
OUTPUT (my PC at work):
Expand|Select|Wrap|Line Numbers
  1. \\rpacfs02\Production  HP8150 PS: cannot Print in Color
  2. \\rpacfs02\Veronica CP3525n: [CAN] Print in Color
  3. \\rpacfs02.rpac.org\Veronica CP3525n: [CAN] Print in Color
  4. \\rpacgc01\KC HM Canon iR3235: cannot Print in Color
  5. \\rpacgc01.rpac.org\HP Color LaserJet 2600n: [CAN] Print in Color
  6. PDF Converter: [CAN] Print in Color
  7. Microsoft XPS Document Writer: [CAN] Print in Color
  8. Microsoft Office Document Image Writer: cannot Print in Color
Expand|Select|Wrap|Line Numbers
  1. If Application.Printer.ColorMode = acPRCMColor Then
  2.   DoCmd.OpenReport "rptColor", acViewNormal
  3. Else
  4.   DoCmd.OpenReport "rptMonochrome", acViewNormal
  5. End If

4 2884
Stewart Ross
2,545 Expert Mod 2GB
Access itself does not interrogate the Windows information about printers installed on your system. Although it would be possible to implement a Windows API call to find out whether a printer is colour-capable, the API wrapper code behind this is quite complex.

I'd suggest that the simplest solution is to ensure that monochrome versions of your report are sufficiently readable that you don't need to know in advance whether or not the printer can print in colour. This may mean using symbols as well as colour shading to allow monochrome differentiation of what the highlights mean.

In monochrome certain colours - red shading, say, - turn so dark that the overlaid text is not readable at all (which may be happening in your case). I would suggest that you choose much lighter highlight shades to avoid this problem, or alternatively use white for the body text in these cases, as white on red is readable and so is white on black or grey in monochrome.

I think it wise to test all reports in monochrome before release. Even with a colour printer, users may choose to print in monochrome (or have such a policy enforced as a default) so it is unwise to assume that printing will be in colour even if the printer is colour-capable.

-Stewart
Nov 19 '11 #2
ADezii
8,834 Expert 8TB
It is a relatively simple matter to tell if a Printer has Color Capabilities, case in point:
Expand|Select|Wrap|Line Numbers
  1. Dim prn As Printer
  2.  
  3. For Each prn In Application.Printers
  4.   With prn
  5.     Debug.Print .DeviceName & ": " & IIf(.ColorMode = acPRCMColor, "[CAN]", "cannot") & _
  6.                               " Print in Color"
  7.   End With
  8. Next
OUTPUT (my PC at work):
Expand|Select|Wrap|Line Numbers
  1. \\rpacfs02\Production  HP8150 PS: cannot Print in Color
  2. \\rpacfs02\Veronica CP3525n: [CAN] Print in Color
  3. \\rpacfs02.rpac.org\Veronica CP3525n: [CAN] Print in Color
  4. \\rpacgc01\KC HM Canon iR3235: cannot Print in Color
  5. \\rpacgc01.rpac.org\HP Color LaserJet 2600n: [CAN] Print in Color
  6. PDF Converter: [CAN] Print in Color
  7. Microsoft XPS Document Writer: [CAN] Print in Color
  8. Microsoft Office Document Image Writer: cannot Print in Color
Expand|Select|Wrap|Line Numbers
  1. If Application.Printer.ColorMode = acPRCMColor Then
  2.   DoCmd.OpenReport "rptColor", acViewNormal
  3. Else
  4.   DoCmd.OpenReport "rptMonochrome", acViewNormal
  5. End If
Nov 20 '11 #3
NeoPa
32,556 Expert Mod 16PB
It's certainly good to know we have coders available that know their way around the object system as well as ADezii :-) It will also give you what you asked for.

Nevertheless, I would not see that as a good reason to overlook Stewart's very sensible advice to design your reports with printer limitations in mind. It's a good policy to follow.

Sometimes you get even more than you ask for here :-D A definite bonus.
Nov 20 '11 #4
Stewart Ross
2,545 Expert Mod 2GB
As ADezii has answered the question you originally asked (and I did not know about the property concerned) I've reset the best answer and would ask you to set it to ADezii's post.

-S
Nov 20 '11 #5

Sign in to post your reply or Sign up for a free account.

Similar topics

3
by: Steven | last post by:
Hi all, Is it possible to do an ie print from javascript that does not bring up the print dialog? I'm in a situation where i need to load a sequence of files into a browser and print all of...
0
by: Peter | last post by:
My client has retail shops. All these shops will access retail application through Internet. So sales receipts will be generated from web/application server and send across Internet to shops. ...
4
by: Salty Dog | last post by:
No error or any feedback that I can work with. Code: set objShell = Server.CreateObject("WScript.Shell") objShell.Run "%comspec% /c NET PRINT \\Garchive\ISLaser >c:\WUTemp\Printer_Status1.txt",...
2
by: Bad_Kid | last post by:
Is it possible to print a page that has no "title" and "page number" on the top and no "link adress" and "date" on the bottom (to print just a page just as it is...)? (how, thanks!)
8
by: stemo76 | last post by:
I have created a report with subform/subreports. I can see all the data on the screen but when I try to print it to a printer or adobe distiller I get 'The Microsoft Jet Database engine could not...
1
by: Michael Schindler | last post by:
I need a repport in my windows c# Apllication. Wich Reports i can use? I'm a little bit confuse with all reports possibilities. I have here post a example as my report would have to look. ...
3
by: Bad_Kid | last post by:
(maybe it is not for this group, but...) Is it possible to print a page that has no "title" and "page number" on the top and no "link adress" and "date" on the bottom (to print just a page just...
3
by: Tamer Ibrahim | last post by:
And to prevent the user from printing more than one copy of this .aspx form, I want to make it disappear just after it has been printed. Any help will be most appreciated. tamer
2
donilourdu
by: donilourdu | last post by:
Hi I am Doni Agna Lourdu. Can any one tell me "How can I print all Web Content" But I know To print background images, open "Tools" menu in Internet Explorer, select...
18
by: =?Utf-8?B?SGVyYg==?= | last post by:
I'm using a ReportViewer in ASP.NET. From the development environment it works fine. When published and I try to open the page with the ReportViewer I get the error: An internal error occurred...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.