Skip to Content
0
Former Member
Dec 08, 2011 at 08:07 PM

VS2010 Add-in OpenDocument

34 Views

I have an urgent need to export a report from a CR2008 server directly to disk in PDF. We normally open the report in a web browser using the OpenDocument. I'm doing this from a Windows Forms application.

I've downloaded/installed the VS2010 add-in and found some code to save directly to disk. I can't find an example of loading a report from the BO server into the Crystal Report ReportDocument object.

Here is a snippet of code.

var exportPath = "c:
exportedfile.pdf";

var crReportDocument = new ReportDocument();

crReportDocument.Load() // This is the line I can't figure out.

crReportDocument.ExportToDisk(ExportformatType.PortableDocFormat, exportPath);

The report is based on a stored procedure so I also need to pass parameters along also.

Thanks in advance.

Jeff