Link to home
Start Free TrialLog in
Avatar of Ralph Gould
Ralph GouldFlag for United States of America

asked on

vba printing of access report to pdf printer looses color

I am creating an acces report that contains color charts. When running completely in access all color is fine. When I change the printer to adobe pdf the resulting file does not retain the colors, everything is black and white. All color files are specified in adobe pdf properties. If I print to the adobe printer from word, the colors are retained.
Avatar of Leigh Purvis
Leigh Purvis
Flag of United Kingdom of Great Britain and Northern Ireland image

Have you checked the printer options as you do the print?
Looked at the preferences - tried different ones?
Avatar of Ralph Gould

ASKER

Yes. I have tried all the options I can find. I also installed pdf995 and tried it with same results. The openreport function is called from a macro that produces the report from a table. If I change the macro to report preview, all is well. When I change back to print and have adobe pdf as the default printer is when I loose the color. Seems to work fine from other office products. BTW its an xp platform all up to date with patches, etc..

And code has the same effect?
DoCmd.OpenReport reportname:="rptName", View:=acViewNormal

What about if you try (the rather nasty)
DoCmd.OpenReport reportname:="rptName", View:=acViewPreview
DoCmd.PrintOut
DoCmd.Close acReport, "rptName", acSaveNo
Tried both of your recommendations, no difference.
Are there any preferences or properties in access that might turn color off?
No - nothing I'm aware of.

Do the labels still come through - and the images... just not in colour?

So when you open the report in print preview mode - and you click Print and get the Print dialog up - and you can view options - printing then maintains colour does it?
I just tested with a freeware version called PDFCreator (http://www.pdfcreator.de.vu). It has an option ([Properties], second tab) to print either in color or in black and white, working as expected. Perhaps you didn't find the option in your version?
Anyway, if it's urgent, download this one, it prints in colors!
;)
What?
Printouts in colour?
What will they think of next.. ;-)
in print preview color is maintained and prints color, but this is coming from access not a pdf converter.

downloaded/installed Harfang's recommendation, however it's the same result - no color.

All of these various converters work with color if I use other MS office products. It is only access that has the problem.
ASKER CERTIFIED SOLUTION
Avatar of Markus Fischer
Markus Fischer
Flag of Switzerland image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
I made a few tests (Access2k, Win2k).

The report stored printer information in three strings:
PrtDevNames - selected printer information
PrtMip - metrics, page layout
PrtDevMode - device setting

The last one has two bytes for:
Color:    An Integer. For a color printer, specifies whether
             the output is printed in color.
             The values are 1 (color) and 2 (monochrome).

So that looked promissing, but I could not make it work. Even choosing 2 (adapting the function in the example section to change orientation), the report would still print in colors...
The only way to get it to print in B&W was to set that option in the printer driver...

Anyway, if you can create -another- report printing in colors, we can transfer these strings from the one that works to the one that doesn't.

Cheers!
voila!!
You (harfang) hit it on the comment re create a new report. The existing report for whatever reason, is corrupt.
Just by creating a new dummy report, the colors are retained. Damn!
Thank you! Thank You!
Well, with both reports open in design view -- let's call them rptBuggy and rptOK -- you can try to fix the bad one like this, from the immediate pane in VB:

Reports("rptBuggy").PrtDevMode = Reports("rptOK").PrtDevMode

Perhaps to the same with PrdDevNames...
That _could_ fix the old report, so that you will not have to start over.
(else, I guess you'll just cut-n-paste the controls  over...)

Good Luck