Error when using PrintToPrinter method - "Invalid report file path"

N

Nicola George

Hi all,

I hope someone can help me as I'm going a bit metal with this problem.

I have a project in ASP.NET, within this project I have Crystal Report
called Catalogue. On an asp page I have a report viewer control
(vwrReportViewer) and a report document control (reportDocument1). On
the load of the page I have the following code.

reportDocument1 = GetCatalogueSampleReport(DBConnectionString(this.Session),
int.Parse(Request.QueryString["CatalogueID"]));
vwrReportViewer.ReportSource = reportDocument1;

GetCatalogueSampleReport returns a report document. I am able to view
the report perfectly.

On this asp page I also have a button, when this is pressed I'd like
to print the report using the PrintToPrinter method of
reportDocument1. Below is the code behind the click event of that
button.

this.reportDocument1.PrintOptions.PrinterName = "\\\\BIGBOSS\\HP
LaserJet 2100 Series PS";
this.reportDocument1.PrintToPrinter(1, false, 0, 0);

I get the following error on calling the PrintToPrint method.

Exception Details: CrystalDecisions.CrystalReports.Engine.LoadSaveReportException:
Invalid report file path.

I can't hard code the report path because I want to be able to use
this viewer for all the reports in this project.

Can anyone help?

Nicola
 

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

Members online

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,009
Latest member
GidgetGamb

Latest Threads

Top