Report Viewer Auto-Sizing

June 6, 2007

I was searching for some information on the report viewer control, and accidentally stumbled upon something I always wanted, but could not seem to figure out.

A combination of 2 properties will have the control automatically size itself to fit the entire report:

 AsyncRendering=false SizeToReportContent=true

The AsyncRendering=false changes the rendering to be in-line instead of a frame, which for whatever reason is required for the SizeToReportContent to work.

A noteworthy side-effect of these settings, is that images that have the “sizing” property set to “AutoSize” do not render correctly. They get shifted and cut off. Changing the sizing to FitProportial cured the rendering problem for me. This was not a property I set myself, so AutoSize must be the default.