Setting the zoom level of a crystal report from code

Posted in: Crystal Reports
By dePoPo
Mar 11, 2009 - 11:01:15 AM

You can set various default zoom levels for your reportviewer, to control how the report is displayed.

Create a form with a crystalreportviewer on it, and set the zoom level to the required value.

A zoom level of 1 fits the report to 'page width'
A zoom level of 2 fits the report to show the full page



' --- set the viewer properties and bind the report

myform.CrystalReportViewer1.DisplayGroupTree = False
myform.CrystalReportViewer1.ReportSource = myreport
myform.CrystalReportViewer1.Zoom(1) ' use 1 for page width, or 2 for full page
myform.CrystalReportViewer1.Refresh()


Visitor Comments