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

Report Viewer Height

2 Answers 178 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Darren
Top achievements
Rank 1
Darren asked on 06 Aug 2009, 03:35 PM
Hi,

I'm trying to make the report viewer height 100%.  I tried following the example in best practices.  I can make it work with this doctype:

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" > 

I tried to use the doctype from the demo:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> 

Here's my ASPX:
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="EventMetrics.aspx.cs" Inherits="GateSureWeb.Reporting.EventMetrics" %> 
 
<%@ Register assembly="Telerik.ReportViewer.WebForms, Version=3.1.9.701, Culture=neutral, PublicKeyToken=a9d7983dfcc261be" namespace="Telerik.ReportViewer.WebForms" tagprefix="telerik" %> 
 
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" > 
 
<html xmlns="http://www.w3.org/1999/xhtml" > 
<head runat="server"
    <title>Event Metrics</title> 
</head> 
<body> 
    <form id="form1" runat="server" style="height: 100%;"
    <div id="content" style="height: 100%;"
     
        <telerik:ReportViewer ID="ReportViewer1" runat="server" Height="100%" Width="100%" 
            Report="EnveraReports.EventMetrics, EnveraReports, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null"
        </telerik:ReportViewer> 
     
    </div> 
    </form> 
</body> 
</html> 
 

Here's my CSS but it didn't work:
body 
    font-family: Arial, Helvetica, Sans-Serif; 
    font-size:10pt; 
    height:100%; 
 
form#form1, div#content 
    height: 100%; 
    width: 100%; 
 

I had to style the report viewer right in the ASPX.

What am I doing wrong?

Thanks,
Darren

2 Answers, 1 is accepted

Sort by
0
Accepted
Chavdar
Telerik team
answered on 06 Aug 2009, 04:41 PM
Hello Darren ,

You have to set height: 100% for the <html> element as well:

<%@ Register Assembly="Telerik.ReportViewer.WebForms" Namespace="Telerik.ReportViewer.WebForms" 
    TagPrefix="telerik" %> 
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> 
<html xmlns="http://www.w3.org/1999/xhtml" style="height: 100%"
<head id="Head1" runat="server"
    <title>Event Metrics</title> 
</head> 
<body style="height: 100%"
    <form id="form1" runat="server" style="height: 100%;"
    <div id="content" style="height: 100%;"
        <telerik:ReportViewer ID="ReportViewer1" runat="server" Height="100%" Width="100%"
        </telerik:ReportViewer> 
    </div> 
    </form> 
</body> 
</html> 
 

Hope this helps.

Best wishes,
Chavdar
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
0
Darren
Top achievements
Rank 1
answered on 06 Aug 2009, 08:09 PM
That was it!  Thanks!
Tags
General Discussions
Asked by
Darren
Top achievements
Rank 1
Answers by
Chavdar
Telerik team
Darren
Top achievements
Rank 1
Share this question
or