Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Automatically print to pdf

Status
Not open for further replies.

Janezz

Programmer
Feb 19, 2004
11
SI
Hi,
I have developed the application in VS.NET with CR.NET. Basically, user enters some parameters for the report, those parameters are sent to the stored procedure, dataset is filled and report is generated and previewed in the Crystal Viewer. After that user clicks Print button, chooses Adobe pdf printer(Adobe Acrobat 6.0 is installed on the machine) and exports the report to a pdf file.
My question is: how can I automate this procedure in code?
For example, all input parameters for the report will be saved in the database, path to pdf file will be saved in the database, user will just click the button and report will be created from the predefined parameters and exported with Adobe pdf printer to the path name saved in the database. No dialog prompt for the file name, no preview of the report.
Is there a way to achieve this?
I know there are export capabilities in CR.NET, but I want this application to be able to print to pdf through Adobe Acrobat which is already present on the machine.

Regards
Janez
 
Janezz,

I don't know how to do this in CR.NET, but in general you can automatically print to a PDF by calling the report object's SetPrinter() method, and passing it the name of the PDF printer. Then call the Printout() method, passing .F. as the first parameter.

Hope this helps.

Mike


Mike Lewis
Edinburgh, Scotland

My Visual Foxpro web site: My Crystal Reports web site:
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top