Wrox Programmer Forums
Go Back   Wrox Programmer Forums > .NET > Other .NET > Crystal Reports
|
Crystal Reports General discussion about Crystal Reports. For discussions specific to the book Professional Crystal Reports for VS.NET, please see the book discussion forum for that book.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Crystal Reports section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old July 1st, 2005, 06:46 AM
Registered User
 
Join Date: Jul 2005
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
Default Printing a Crystal Report from the Web

Hopefully some one out there can tell me what I am doing wrong.

I am able to create a Crystal Report on a ASP.NET page. The report is connecting to SQL Server 2000 and running a stored procedure to get the data. All this works no problem. It all starts to go wrong when I try to export the file as a PDF file in order to print off the report. I can set up the code to do everything but as soon as I try the export method I get a 'Missing parameter field current value' error. Remove the export method it works fine. What am I doing wrong? My code is below. Thanks.


//create the strong typed report object
essentialReport = new EssentialReport();
this.essentialReport.SetDatabaseLogon(user, pass);

this.crTableLogonInfos = new TableLogOnInfos();
this.crTableLogonInfo = new TableLogOnInfo();

//connect to DWH and PLDWH
crCon = new ConnectionInfo();
crCon.ServerName = server;
crCon.DatabaseName = db;

this.crTableLogonInfo.ConnectionInfo = this.crCon;
this.crTableLogonInfo.TableName = "RangeCheck_EssentialReport";
this.crTableLogonInfos.Add(this.crTableLogonInfo);

//bind viewer to report
this.essentialReportViewer.LogOnInfo = this.crTableLogonInfos;
essentialReportViewer.ReportSource = this.essentialReport;

passReportParamenters();

fname = "c:\\Crystal\\CRNET\\"+Session.SessionID.ToString( )+".pdf";
this.crDiskFileDestinationOptions = new DiskFileDestinationOptions();
this.crDiskFileDestinationOptions.DiskFileName = this.fname;
this.essentialReport.ExportOptions.ExportDestinati onType = ExportDestinationType.DiskFile;
this.essentialReport.ExportOptions.ExportFormatTyp e = ExportFormatType.PortableDocFormat;
this.essentialReport.ExportOptions.DestinationOpti ons = this.crDiskFileDestinationOptions;

//passReportParamenters();
this.essentialReport.Export();

}
catch (LogOnException loe)
{
    Session.Add("Error", loe.ToString());
    Server.Transfer("Error.aspx");
}
}






Similar Threads
Thread Thread Starter Forum Replies Last Post
printing problem in crystal report 8.0 arumugavel Crystal Reports 0 August 28th, 2007 10:33 PM
Crystal Report printing k.manisha ASP.NET 1.0 and 1.1 Professional 0 September 30th, 2006 01:11 AM
Printing Crystal Report as PDF dkspivey ASP.NET 1.0 and 1.1 Basics 0 January 5th, 2006 11:32 AM
problem in crystal report printing tarun VB Components 1 May 16th, 2005 07:08 AM
Error While printing report (Crystal report) vikaspaweb Pro VB 6 0 March 8th, 2004 09:53 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.