• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1121
  • Last Modified:

Adobe 7 Professional prints color reports in black and white

This is really odd, but when I automatically print to Adobe pdf my color reports change to black and white. This does not happen with any other driver like pdffactory, but I ma now running into an issue with a logo that prints poorly in pdffactory, but great in Adobe, however it converts the whole report to black and white.

Any ideas? Anyone else seen this weird problem?

Thanks!
0
gaynes
Asked:
gaynes
1 Solution
 
gh081410Commented:
Perhaps you default seting of adobe is in black and white?????
Just guessing

Good luck!
0
 
gaynesAuthor Commented:
no, it is standard
0
 
gaynesAuthor Commented:
Thanks to fabulous ACG Soft for the answer


Yes, we've seen it before, its related to an element of the prtDevMode property that is stored with the report in your database.   Cut and paste the code below into a module in your application.  Run the SetRptColor function from the immediate window specifying the report you are targeting and that should solve the problem.

Regards

Software Tools Group
ACG Soft

-----------------

Option Compare Database
Option Explicit

Private Type DEV_MODE_NARROW
    dmDeviceName As String * 16
    dmSpecVersion As Integer
    dmDriverVersion As Integer
    dmSize As Integer
    dmDriverExtra As Integer
    dmFields As Long
    dmOrientation As Integer
    dmPaperSize As Integer
    dmPaperLength As Integer
    dmPaperWidth As Integer
    dmScale As Integer
    dmCopies As Integer
    dmDefaultSource As Integer
    dmPrintQuality As Integer
    dmColor As Integer
    dmDuplex As Integer
    dmYResolution As Integer
    dmTTOption As Integer
    dmCollate As Integer
    dmFormName As String * 16
    dmLogPixels As Long
    dmBitsPerPel As Long
    dmPelsWidth As Long
    dmPelsHeight As Long
    dmDisplayFlags As Long
    dmDisplayFrequency As Long
End Type
Private Type DEV_MODE_STRING_WIDE
    RGB As String * 6144
End Type
Private Type DEV_MODE_STRING_NARROW
    RGB As String * 94
End Type

Function SetRptColor(strRptName As String, Optional bColorMode As Byte = 2) As Long
'-------------------------------------
'Purpose:  Sets a report's color settings
'Accepts:  strRptName: Name of a Report to Set
'          bColorMode: 1 = monochrome, 2 = Color
'--------------------------------------
On Error GoTo Err_SPP
Dim dwOK As Long, lngOrigFields&, lngDMLen As Long
Dim strRptDevMode As String
Dim dmAnsiStructOnlyStr As DEV_MODE_STRING_NARROW
Dim udtDM As DEV_MODE_NARROW, udtDMstr As DEV_MODE_STRING_WIDE
Dim boolFormUse As Boolean
Dim objFrm As Form
Const DM_COLOR = &H800

boolFormUse = False
Set objFrm = Screen.ActiveForm
boolFormUse = True
'Open report get its base settings
NoForm:
DoCmd.Echo False
DoCmd.OpenReport strRptName, acDesign
Reports(strRptName).Painting = False
DoCmd.ShowToolbar "Report Design", acToolbarNo
DoCmd.ShowToolbar "ToolBox", acToolbarNo
DoCmd.ShowToolbar "Formatting (Form/Report)", acToolbarNo
DoCmd.SetWarnings False
'Refocus on the form if in use
If boolFormUse = True Then
    DoCmd.SelectObject acForm, objFrm.Name
End If
Application.Echo True
'Add the settings desired
If Not IsNull(Reports(strRptName).PrtDevMode) Then
    'set the byte array into the struct
    udtDMstr.RGB = Reports(strRptName).PrtDevMode
    LSet udtDM = udtDMstr
    lngDMLen = udtDM.dmSize + udtDM.dmDriverExtra
    lngOrigFields = udtDM.dmFields
    If Not IsMissing(bColorMode) Then
        udtDM.dmFields = lngOrigFields Or DM_COLOR
        udtDM.dmColor = bColorMode
    End If
    LSet dmAnsiStructOnlyStr = udtDM
    Mid(udtDMstr.RGB, 1, 54) = dmAnsiStructOnlyStr.RGB
    strRptDevMode = left(udtDMstr.RGB, lngDMLen)
    Reports(strRptName).PrtDevMode = strRptDevMode
End If

CloseRpt:
On Error Resume Next
Application.Echo False
Reports(strRptName).Painting = True
DoCmd.Close acReport, strRptName
DoCmd.ShowToolbar "Report Design", acToolbarWhereApprop
DoCmd.ShowToolbar "ToolBox", acToolbarWhereApprop
DoCmd.ShowToolbar "Formatting (Form/Report)", acToolbarWhereApprop
DoCmd.SetWarnings True
Application.Echo True
SetRptColor = True
Exit_SPP:
    Exit Function
Err_SPP:
Select Case Err.Number
Case 2103, 2451
    SetRptColor = False
    Application.Echo True
    MsgBox "Error: The report: """ & strRptName & """, is no longer valid, or the report is missing from this application.", vbCritical, "Report SetUp"
    Resume Exit_SPP
Case 2475  'No form is active
    Resume NoForm
Case 2601
    Application.Echo True
    SetRptColor = False
    MsgBox "Error: You don't have the proper permissions for """ & strRptName & """ to allow the application to make proper settings.", vbCritical, "Report Set Up"
    Resume Exit_SPP
Case 2094 'Toolbar not found
    Resume Next
Case Else
    Application.Echo True
    MsgBox "Error: " & Err & " " & Error$, , "Report Set Up"
    SetRptColor = False
    Err.Clear
    Resume CloseRpt
End Select
End Function
0
Ultimate Tool Kit for Technology Solution Provider

Broken down into practical pointers and step-by-step instructions, the IT Service Excellence Tool Kit delivers expert advice for technology solution providers. Get your free copy now.

 
gaynesAuthor Commented:
Please close this question. I added the answer. Thanks!
0
 
harfangCommented:
Hello gaynes,

See help on "I answered my question myself. What do I do?" http:/help.jsp#hi70
You basically post a request in http:/Community_Support/ with

    I answered my own question

    Please PAQ and refund http:/Q_21874942.html#16837979

Cheers!
(°v°)
0
 
CetusMODCommented:
PAQed with points refunded (125)

CetusMOD
Community Support Moderator
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Get expert help—faster!

Need expert help—fast? Use the Help Bell for personalized assistance getting answers to your important questions.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now