{"id":152,"date":"2012-04-26T19:18:53","date_gmt":"2012-04-26T13:18:53","guid":{"rendered":"http:\/\/markwheeler.com\/wordpress\/?p=152"},"modified":"2012-04-26T19:18:53","modified_gmt":"2012-04-26T13:18:53","slug":"dynamically-resize-sharepoint-2010-report-viewer-web-part","status":"publish","type":"post","link":"https:\/\/markwheeler.com\/?p=152","title":{"rendered":"Dynamically Resize Sharepoint 2010 Report Viewer Web Part"},"content":{"rendered":"<p>Came across <a href=\"http:\/\/www.mattkoon.net\/articles\/sharepoint\/sharepoint-reporting-services-dynamic-height-web-parts-jquery-0\" target=\"_blank\" rel=\"noopener\">this blog<\/a> which shows how to dynamically resize a Reporting Services Viewer Web Part to fit the height of the content\/report using <a href=\"http:\/\/jquery.com\/\" target=\"_blank\" rel=\"noopener\">JQuery<\/a>.<\/p>\n<p>Here&#8217;s the code for completeness. For my execution, I placed this on an HTML page and call it through a Content Editor Web Part.<\/p>\n<p>&lt;script src=&#8221;jquery-1.7.2.min.js&#8221;&gt;&lt;\/script&gt;<br \/>\n&lt;script type=&#8221;text\/javascript&#8221;&gt;<br \/>\n$(window).load(function() {<br \/>\nsetTimeout(&#8220;FixReportZoneHeight();&#8221;,2000);<br \/>\n});<br \/>\n&lt;\/script&gt;<\/p>\n<p>&lt;script type=&#8221;text\/javascript&#8221;&gt;<br \/>\nfunction FixReportZoneHeight() { try { $(&#8216;div[id^=&#8221;WebPartWPQ&#8221;] div div&#8217;).each(function() { $(this).addClass(&#8216;dynamic-height&#8217;); }); } catch(err) {} }<br \/>\n&lt;\/script&gt;<\/p>\n<p>&lt;Style type=&#8221;text\/css&#8221;&gt;<br \/>\n.dynamic-height {height:auto !important;}<br \/>\n&lt;\/Style&gt;<\/p>\n<p>Set your Report Viewer Web Part like this; I use a fixed width, but not necessary.<\/p>\n<p><a href=\"http:\/\/markwheeler.com\/wordpress\/wp-content\/uploads\/2012\/04\/variable-height-web-part.png\"><img loading=\"lazy\" decoding=\"async\" class=\"alignleft size-full wp-image-156\" title=\"variable height web part\" src=\"http:\/\/markwheeler.com\/wordpress\/wp-content\/uploads\/2012\/04\/variable-height-web-part.png\" alt=\"\" width=\"270\" height=\"276\" \/><\/a><\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>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&#8217;s the code for completeness. For my execution, I placed this on an HTML page and call it through a Content Editor Web Part. &lt;script [&hellip;]<\/p>\n","protected":false},"author":3,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_monsterinsights_skip_tracking":false,"footnotes":""},"categories":[2,10,11],"tags":[42,92,99,106],"class_list":["post-152","post","type-post","status-publish","format-standard","hentry","category-computer","category-sharepoint","category-software","tag-dynamic-resize","tag-report-viewer-web-part","tag-sharepoint-2010","tag-sql-reporting-services"],"jetpack_featured_media_url":"","_links":{"self":[{"href":"https:\/\/markwheeler.com\/index.php?rest_route=\/wp\/v2\/posts\/152","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/markwheeler.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/markwheeler.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/markwheeler.com\/index.php?rest_route=\/wp\/v2\/users\/3"}],"replies":[{"embeddable":true,"href":"https:\/\/markwheeler.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=152"}],"version-history":[{"count":0,"href":"https:\/\/markwheeler.com\/index.php?rest_route=\/wp\/v2\/posts\/152\/revisions"}],"wp:attachment":[{"href":"https:\/\/markwheeler.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=152"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/markwheeler.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=152"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/markwheeler.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=152"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}