Printing Crystal Reports in a Windows Forms App

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hello,

I have an application that uses the version of CR.NET that came with VS.NET
2003. The CrystalReportViewer control prints the report fine when initiated
by the user on the form, but I have problems when I try to call PrintReport()
or PrintToPrinter(1, false, 1, 2).

Calling either meathod, I get the following error:

" '-1' is not a valid value for 'value'. 'value' must be greater than or
equal to 0. "

and blank reports print out.

I googled this error, but did not find any sites with my problem.

Has anyone here seen this?

Thanks in advance for your help,

Paul
 
Did you ever find an answer for this problem?
If so, I am having this problem and would like your help.

Thanks,
Don
 
I guess you give a reportdocument object to crystal report viewer as report
source. I got this error too, what I did was instead of using Print method
of the crystal report viewer using the "PrintToPrinter" method of the report
document. Like:

reportDocument.PrintToPrinter(1,false,0,0);

The methods takes the following parameters:
PrintToPrinter (int nCopies, bool collated, int startPage, int endPage)
 
Back
Top