Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Printing without a CrystalReportViewer

Status
Not open for further replies.

MMock

Programmer
Aug 23, 2007
17
US
I have a windows application developed in VB.NET 2005.

I have a main screen from which the user might want to run a report. I have the report developed. If I view the report and print it through CrystalReportViewer it works as would be expected. However, the user does not always want to view the report and print it from there. He might just want to call up his data on my windows form and hit a print button.

How do I print a Crystal Report this way?

Thanks.
 
I am still using the CrystalReportViewer to print. I am just not showing the form it's on.

Is this approach correct?

What I did was take all the code that runs when the user wants to look at a report. But I never execute the Show() method on the form containing the viewer:

frmCurrentComponent.Show()

I then execute the code that's in this form's load event so I can pass the parameters and the login info. Then I do this:

frmCurrentComponent.CrystalReportViewer1.PrintReport()

So the only difference between looking at the report and printing the report without looking at it is, in the former case I don't execute a PrintReport() and in the latter case I don't execute a frm.Show().

I just wanted this verified by someone who's been using Crystal for a while since I just started with it this month.

Thanks.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top