Apr 262012

Came across this blog which shows how to dynamically resize a Reporting Services Viewer Web Part to fit the height of the content/report using JQuery.

Here’s the code for completeness. For my execution, I placed this on an HTML page and call it through a Content Editor Web Part.

<script src=”jquery-1.7.2.min.js”></script>
<script type=”text/javascript”>
$(window).load(function() {

<script type=”text/javascript”>
function FixReportZoneHeight() { try { $(‘div[id^=”WebPartWPQ”] div div’).each(function() { $(this).addClass(‘dynamic-height’); }); } catch(err) {} }

<Style type=”text/css”>
.dynamic-height {height:auto !important;}

Set your Report Viewer Web Part like this; I use a fixed width, but not necessary.