Report Viewer Auto-Sizing

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.

4 Responses to “Report Viewer Auto-Sizing”

  1. DRWebMonkey Says:

    I have been looking for this, and I thought that it could not be done!
    Great help!

  2. justly Says:

    justly says : I absolutely agree with this !

  3. Edwar Says:

    Hi:

    Thanks a lot for this one, what a big help!!!

    Thanks and greets from Bogota!!!

  4. Amorim Says:

    Very nice tip!

Leave a Reply