This is a migrated thread and some comments may be shown as answers.

Report Viewer height 100% not working

4 Answers 395 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Regeesh Joseph
Top achievements
Rank 1
Regeesh Joseph asked on 12 Oct 2010, 03:03 PM
Hai,

I have created one Telerik Report. I set the height of the report viewer as 100% in aspx page. In my development PC, it is showing properly. But in deployment, it shows only 40% of the screen height. There is a scroll bar to scroll down evenif the data is small to display on one page. No need to show the scrollbar, if the data can be shown on one page. I have attached the screenshot of the page. Please send me a solution as soon as possible. Its very urgent..Please.

Thanks & regards,
Regeesh Joseph

4 Answers, 1 is accepted

Sort by
0
Steve
Telerik team
answered on 15 Oct 2010, 09:57 AM
Hi Regeesh Joseph,

If this works properly on your dev machine, it should function on another machine as well as the height is controlled in the html markup. See this help article for more information: How do I set 100% height to the Web Report Viewer.

Regards,
Steve
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
0
Travis
Top achievements
Rank 1
answered on 15 Mar 2011, 05:33 PM

Telerik's solution did not work for me.  My problem was that I had some content on the page which was a header to the report viewer control.  If I set the height of the report viewer and its container to be 100%, then it ends up being longer/higher than the page height in IE 8.  I couldn't seem to find a way to set the report viewer to be "the rest" of the window height using "100%" or css.  The javascript code below which gets the client window height was a better solution for me.  Maybe it will work for someone else as well:

<div id="ReportViewerDiv">
    <telerik:ReportViewer ID="MyReportViewer" runat="server" Width="100%" Height="100%">
    </telerik:ReportViewer>
    </div>
    <script language="javascript">
        function GetWindowHeight() {
            var y = 0;
            var minHeight = 200; //min height of the report viewer control
            var heightOffset = 385; //this is the height of the rest of the page excluding the report viewer.  You can determine this by getting the client height of a container or set it statically
  
            if (self.innerHeight) {
                y = self.innerHeight;
            }
            else if (document.documentElement && document.documentElement.clientHeight) {
                y = document.documentElement.clientHeight;
            }
            else if (document.body) {
                y = document.body.clientHeight;
            }
  
  
            if ((y - heightOffset) > minHeight)
            {
                document.getElementById("ReportViewerDiv").style.height = (y - heightOffset) + "px";
            }
            else
            {
                document.getElementById("ReportViewerDiv").style.height = minHeight + "px";
            }
        }
        GetWindowHeight();
    </script>
0
danparker276
Top achievements
Rank 2
answered on 31 Aug 2012, 07:29 PM
Neither solution works for me.  Gotta love HTML and javascript!
0
Paul R.
Top achievements
Rank 1
answered on 21 Sep 2012, 02:33 PM
Travis, thank you for your post, that fixed my issue with the report shrinkage!
Tags
General Discussions
Asked by
Regeesh Joseph
Top achievements
Rank 1
Answers by
Steve
Telerik team
Travis
Top achievements
Rank 1
danparker276
Top achievements
Rank 2
Paul R.
Top achievements
Rank 1
Share this question
or