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

Report viewer not displaying report

1 Answer 419 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Ron
Top achievements
Rank 1
Ron asked on 09 Feb 2011, 09:30 PM
I have an aspx page with a report viewer on it that is not rendering a report. The report does render in the report designer.  When I test it in debug mode it does not stop on the  Page_Load sub as expected.  The code is short, so I've included it:


<%@ Page Language="VB" AutoEventWireup="false" CodeFile="RptViewer.aspx.vb" Inherits="RptViewer" %>

<%@ Register assembly="Telerik.ReportViewer.WebForms, Version=4.2.10.1221, Culture=neutral, PublicKeyToken=a9d7983dfcc261be" 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">
<head id="Head1" runat="server">
    <title>telerik Report Viewer</title>
    <style type="text/css">           
        html#html, body#body, form#form1, div#content, center#center
        {   
            border: 0px solid black;
            padding: 0px;
            margin: 0px;
            height: 100%;
        }
    </style>
</head>
<body id="body">
    <form id="form1" runat="server">              
    <div id="content"><center id="center"><telerik:ReportViewer ID="ReportViewer1"
            runat="server"  style="border:1px solid #ccc;"
            width="99%" height="99%" Skin="WebBlue"/></center></div>
    </form>
</body>
</html>

The codebehind:

Imports System
Imports System.Web.UI
Imports Telerik.Reporting
Imports Reports

Partial Class RptViewer
    Inherits System.Web.UI.Page

    Protected Sub Page_load(ByVal sender As Object, ByVal e As EventArgs)
        If Not IsPostBack Then
            Dim rpt As New PDS
            Me.ReportViewer1.Report = rpt
        End If
    End Sub
End Class


Thank you
Ron

1 Answer, 1 is accepted

Sort by
0
Ron
Top achievements
Rank 1
answered on 10 Feb 2011, 03:23 AM
I found that the problem was the line:

 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

Once I removed this line the reports displayed. I discovered this by being able to output them but not view them.

Hope this helps someone else.

Ron
Tags
General Discussions
Asked by
Ron
Top achievements
Rank 1
Answers by
Ron
Top achievements
Rank 1
Share this question
or