How do I pass parameters thru Crystal to modify printer behavior?

H

Hexman

Hello All,

I have a new challenge. I've created a Crystal Report (version 10) and saved the file. Now from my program I want to print it to an Adobe PDF file.
My question is: How do I pass parameters thru Crystal to modify printer behavior?

For Instance:
1. Pass it a path & filename to save to. eg; "C:\ReportDist\R100102-060902.pdf" (included the date in the filename)
2. Tell the Adobe PDF printer to overwrite an existing file if present.
Other things like 1 & 2 above.

I'm using Adobe Acrobat v7.0 Pro. I do not have their SDK. I only want the the larger reports to go to PDF. The others I will be printing to their
local printer. Any other way to accomplish the same?

Thanks,

Hexman


My code is pretty straight forward.

private sub PrintReport102()
Dim reportPath As String = "C:\ReportDefs\"
Dim reportName As String = "R100102.rpt"

Dim myReportDocument As ReportDocument = New ReportDocument()
myReportDocument.Load(reportPath & reportName)
myReportDocument.SetParameterValue("SelectedDate", "09/02/2006")
myReportDocument.PrintOptions.PrinterName = "Adobe PDF"
myReportDocument.PrintToPrinter(1, True, 1, 999)
end sub
 
H

Hexman

I've been used to creating PDF's with Acrobat that I didn't look deep enough into CR. To do what I need to do, just used the export command instead
of "PrintToPrinter". All path and filename properties are available!!

Hexman
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top