User login

Who's online

There are currently 0 users and 99 guests online.

Advertisements


SourceForge.net Logo

No color in charts using cls options

Submitted by bhughesiii2187 on Fri, 2008-03-28 22:26.

I have an access applicatiob i am designing that uses VBA to call an instance of PDFCreator and uses the /NoProcessingAtStartup option and a few other options so that I can print multiple access reports into one PDF. The problem is however, that my charts and graphs do not contain any color to them. If I open a single report and print directly to PDFCreator, the color is there. However when I use my batch code, there is no color.. See batch code below.

'If option is print to PDF set default printer to PDFCreator and start PDFCreator
strDefaultPrinter = Application.Printer.DeviceName
Set Application.Printer = Application.Printers("PDFCreator")
Set pdfjob = New clsPDFCreator
pdfjob.cStart "/NoProcessingAtStartup"
With pdfjob
.cPrinterStop = True
.cOption("UseAutoSave") = 1
.cOption("UseAutoSaveDirectory") = 1
.cOption("AutoSaveDirectory") = pdfpath
.cOption("AutoSaveFilename") = pdfname
.cOption("AutoSaveFormat") = 0 '0 = PDF
.cClearCache

If rt.RecordCount > 1 Then
DoCmd.OpenReport "rpt1", acViewNormal
End If

For pgA = 0 To rt.RecordCount - 1
RPT = "rpt" & Rprt(0, pgA)
DoCmd.OpenReport RPT, acViewNormal
Next pgA

If rt.RecordCount = 1 Then
Do Until pdfjob.cCountOfPrintjobs = 1
DoEvents
Loop
Else
Do Until pdfjob.cCountOfPrintjobs = pgA + 1
DoEvents
Loop
End If

.cCombineAll

.cPrinterStop = False

Do Until pdfjob.cCountOfPrintjobs = 0
DoEvents
Loop

'Wait 10 seconds
Sleep (10000)

' DoCmd.SetWarnings False
' DoCmd.RunSQL ("delete * from scarlet")

.cCloseRunningSession

End With
Set Application.Printer = Application.Printers(0)
Set pdfjob = Nothing
Sleep (1000)

'Set data paths. Where file is located and location to copy data
DestName1 = "X:\PDF\"
DirName1 = "C:\portfolio\TEMPDATA\"
nextbookA = Dir(DirName1 & "*.pdf")
If nextbookA <> "" Then
FileCopy DirName1 & nextbookA, DestName1 & nextbookA
Kill DirName1 & nextbookA
End If

Can anyone help? I think i have to set a .cOption for color but not sure

© 2006 by pdfforge.org :: Contact us

Validate XHTML or CSS.