Print Page | Close Window

Programatically Export Report to Pdf

Printed From: Crystal Reports Book
Category: Crystal Reports for Visual Studio 2005 and Newer
Forum Name: Writing Code
Forum Discription: .NET programming API, report integration
URL: http://www.crystalreportsbook.com/forum/forum_posts.asp?TID=789
Printed Date: 02 May 2025 at 12:39am


Topic: Programatically Export Report to Pdf
Posted By: JohnS.
Subject: Programatically Export Report to Pdf
Date Posted: 05 Jun 2007 at 1:26pm
Hey all,
 
I have a windows app that has an accounting section, where we track costs of projects. When we want to bill a customer we create a new invoice of of the main project totals. Since the main project totals get updated every time we need to create an invoice, i need to keep track of previous totals. There by creating a report of this previous totals section, when we create a new invoice i need to export the report in the back ground to a file that we can refer to when we want. My question is how can i asign a file name to the report in the background with out the user getting in volved and then export it automaticaly to a pdf. in the same folder as the rest of the previous reports.
 
 
John S.
 



Replies:
Posted By: hilfy
Date Posted: 06 Jun 2007 at 8:53pm
If you're trying to export the report programmatically, you don't need the viewer.  You just need to load the report into a ReportDocument object and then export if from there.  Assuming that this is a .NET app, you can find sample code for exporting in the Crystal Reports .NET SDK section of the Developer Library (go to http://diamond.businessobjects.com/developer/library - http://diamond.businessobjects.com/developer/library  and select the version that you're using (XI, XI r2 or XI r2 sp2).  If you download the Sample Code, you'll find both ASP.NET and WinForms samples in the zip file.
 
(I spent some time today working on a similar issue, that's how I know the code is there in the samples!)
-Dell


-------------
Proviti, Data & Analytics Practice
http://www.protiviti.com/US-en/data-management-advanced-analytics - www.protiviti.com/US-en/data-management-advanced-analytics



Print Page | Close Window