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 gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Print report from Visual Basic 6

Status
Not open for further replies.

Sasquatch69

Programmer
Sep 20, 2002
19
CA
Hi,
I got a little problem printing a report(crystal report) from visual basic. I open the report without problem and i can print the report when is open. But if i try to print it with:

ReportViewerFrm.CRViewer1.PrintReport

It does'nt work!!!! but if i run my program in step by step mode, it work!!!!

Anyone know a solution????

Thank, and sorry if my bad english...
 
Use the PrintOut method of the report object instead of the PrintReport method of the viewer. So, given a report object name crRpt, you would use this line of code instead of previewing in the viewer:

crRpt.PrintOut

The PrintOut method takes potentially 5 arguments, but if you want to prompt the user for things like how many copies or what page range to print, just use the following line:

crRpt.PrintOut True

If you just want to print the report with all the defaults, use:

crRpt.PrintOut False

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top