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

Telerik Reporting Not Working in Visual Studio 2012 with .NET framework 4.5

1 Answer 169 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
USMAN
Top achievements
Rank 1
USMAN asked on 31 May 2013, 02:34 PM
Hi Friends,

I have created a Telerik Report using ( Q1 2013 - 7.0.13.426 ) in Visual Studio 2012 with MVC4 Application using .NET 4.5 Framework.

The Report Viewer loads it self, but it didn't render the report, and when ever I click on any button within Report viewer it popup the Alert box, with that command name. But it is not displaying any thing in report.

here is the html mark-up code for Report viewer

<%@ Control Language="C#" Inherits="System.Web.Mvc.ViewUserControl<dynamic>" %>
<%@ Import Namespace="PaceSoftware.Models" %>
<%@ Register Assembly="Telerik.ReportViewer.WebForms, Version=7.0.13.426, Culture=neutral, PublicKeyToken=a9d7983dfcc261be" Namespace="Telerik.ReportViewer.WebForms" TagPrefix="telerik" %>
<!DOCTYPE html>
<script runat="server">
 
    protected void Page_Load(object sender, EventArgs e)
    { }
     protected override void OnLoad(EventArgs e)
    {
        base.OnLoad(e);
        Telerik.Reporting.Report rpt = new PaceSoftware.Reports.CustomerReport();
        rptCustomerReport.ReportSource = rpt;
    }
</script>
 
<html>
<head id="Head1" runat="server">
    <title>Balance Report</title>
</head>
<body>
    <form id="form1" method="post" runat="server">
        <div align="center" style="height: 1400px">
            <table class="NoBorderTables" style="width: 100%">
                <tr>
                    <td>
 
<telerik:ReportViewer ID="rptCustomerReport" runat="server" Width="100%" Height="1300px"
   ViewMode="PrintPreview"  Report="PaceSoftware.Reports.CustomerReport, PaceSoftware">
</telerik:ReportViewer>
 
                    </td>
                </tr>
            </table>
        </div>
    </form>
</body>
</html>


I have also tried to use the following Code, But no LUCK :-(

<%@ Control Language="C#" Inherits="System.Web.Mvc.ViewUserControl<dynamic>" %>
 
 
<%@ Register Assembly="Telerik.ReportViewer.WebForms, Version=7.0.13.426, Culture=neutral, PublicKeyToken=a9d7983dfcc261be" Namespace="Telerik.ReportViewer.WebForms" TagPrefix="telerik" %>
<!DOCTYPE html>
<script runat="server">
 
    protected void Page_Load(object sender, EventArgs e)
    {
 
    }
 
    protected override void OnLoad(EventArgs e)
    {
        base.OnLoad(e);
 
         
    }
     
</script>
 
<html>
<head id="Head1" runat="server">
    <title>Balance Report</title>
</head>
<body>
    <form id="form1" runat="server">
        <div align="center" style="height: 1400px">
            <table class="NoBorderTables" style="width: 100%">
                <tr>
                    <td>
 
                        <telerik:ReportViewer ID="rptCustomerReport" runat="server" Width="100%" Height="1300px" ViewMode="PrintPreview">
<typereportsource typename="PaceSoftware.Reports.CustomerReport, PaceSoftware, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null"></typereportsource>
                        </telerik:ReportViewer>
 
 
                    </td>
                </tr>
            </table>
        </div>
    </form>
</body>
</html>

both the above codes didn't throw any error, that's why it becomes very difficult to know either what is happening....!!!

It just display the white sheet of report nothing in it, and when ever I click on any button of the report it display the alert box, with the command name in it... 

I have also attached the screen shot.

Please help me to solve this issue...

Many Thanks.

1 Answer, 1 is accepted

Sort by
0
USMAN
Top achievements
Rank 1
answered on 31 May 2013, 04:01 PM
Thanks I have SOLVED the Problem

I was creating a Partial view, but we need to create a View without Master page

and I have changed my code and following is the code I have used

before I was forget to add the following reference

<%@ Register Assembly="Telerik.Reporting, Version=7.0.13.426, Culture=neutral, PublicKeyToken=a9d7983dfcc261be" Namespace="Telerik.Reporting" TagPrefix="telerik" %>

So this time I have added this.

<%@ Page Language="C#" Inherits="System.Web.Mvc.ViewPage<dynamic>" %>
 
<%@ Register Assembly="Telerik.ReportViewer.WebForms, Version=7.0.13.426, Culture=neutral, PublicKeyToken=a9d7983dfcc261be" Namespace="Telerik.ReportViewer.WebForms" TagPrefix="telerik" %>
<%@ Register Assembly="Telerik.Reporting, Version=7.0.13.426, Culture=neutral, PublicKeyToken=a9d7983dfcc261be" Namespace="Telerik.Reporting" TagPrefix="telerik" %>
 
<!DOCTYPE html>
 
<html>
<head runat="server">
    <meta name="viewport" content="width=device-width" />
    <title>Overdue Report</title>
</head>
<body>
    <form id="form1" runat="server">
    <script runat="server">
 
    protected void Page_Load(object sender, EventArgs e)
    { }
 
    protected override void OnLoad(EventArgs e)
    {
        base.OnLoad(e);
 
        // bind the report viewer
 
        var rptInstance = new Telerik.Reporting.InstanceReportSource();
        rptInstance.ReportDocument = new PaceSoftware.Reports.CustomerReport();
        rptCustomerReport.ReportSource = rptInstance;
    }
     
</script>
    <div>
         
        <telerik:ReportViewer ID="rptCustomerReport" runat="server"  Width="100%" Height="1300px" ViewMode="PrintPreview">
</telerik:ReportViewer>
         
    </div>
    </form>
</body>
</html>


Everything is NOW WORKING [SOLVED]

Thanks.
Tags
General Discussions
Asked by
USMAN
Top achievements
Rank 1
Answers by
USMAN
Top achievements
Rank 1
Share this question
or