Nerd Nord
Nerd Nord

Reputation: 151

The base class includes the field 'report', but its type (Microsoft.Reporting.WebForms.ReportViewer) is

I'm desperate. I have this page with a report viewer that worked until a couple of days ago. I haven't changed my webconfig or anything else, but I am getting this error now. Here's my ASP.NET code:

<%@ Page Title="" Language="C#" MasterPageFile="~/Site.Master" AutoEventWireup="true" CodeBehind="RisultatoStampaPdf.aspx.cs" Inherits="Fatture.Pagine.StampaDocumenti.RisultatoStampaPdf" %>

<%@ Register Assembly="Microsoft.ReportViewer.WebForms, Version=11.0.0.0, Culture=neutral, PublicKeyToken=89845dcd8080cc91" Namespace="Microsoft.Reporting.WebForms" TagPrefix="rsweb" %>
<asp:Content ID="Content1" ContentPlaceHolderID="HeadContent" runat="server">
---code---

</asp:Content>

<asp:Content ID="Content2" ContentPlaceHolderID="BodyContent" runat="server">
    <div align="center">
        <h4>Premere il pulsante "Salva" e scegliere il formato desiderato</h4>
        <asp:Label ID="lblErrore" runat="server" Text=""></asp:Label>
        <rsweb:ReportViewer runat="server" ID="report" Font-Names="Calibri" Font-Size="12pt" WaitMessageFont-Names="Calibri" WaitMessageFont-Size="14pt" Width="740px" Height="500px">
            <LocalReport ReportPath="ReportFatture.rdlc">
                <DataSources>
                    <rsweb:ReportDataSource DataSourceId="ObjectDataSource2" Name="DataSet2" />
                </DataSources>
            </LocalReport>
        </rsweb:ReportViewer>
        <asp:ObjectDataSource ID="ObjectDataSource2" runat="server" OldValuesParameterFormatString="original_{0}" SelectMethod="GetData" TypeName="Fatture.DataSet2TableAdapters.DataTable1TableAdapter">
            <SelectParameters>
                <asp:Parameter Name="id_documento" Type="Int64" />
                <asp:Parameter Name="id_cliente" Type="Int64" />
            </SelectParameters>
        </asp:ObjectDataSource>
        <br />
        <asp:Button ID="btnReindirizza" class="btn btn-info" runat="server" Text="Torna indietro" OnClick="btnReindirizza_Click" />
        <hr />
    </div>
</asp:Content>

I am using .NET Framework 4.51.

Upvotes: 5

Views: 24360

Answers (1)

israel altar
israel altar

Reputation: 1794

I've found an answer that seems to make sense:

Try to add the reference: Microsoft.Reporting.WebForms and afterward, if you get another error try to compare between <%@ Register Assembly="Microsoft.ReportViewer.WebForms, Version=11.0.0.0 and the version that is written in the reference you added, if there is a difference change the version to the version of the Microsoft.ReportViewer.WebForms.

hope it'll help. here is a link: https://mohamedelkassas.wordpress.com/2014/04/21/the-base-class-includes-the-field-xxx-but-its-type-microsoft-reporting-webforms-reportviewer-is-not-compatible-with-the-type-of-control-microsoft-reporting-webforms-reportviewer/

and another one with another solution: http://snahta.blogspot.co.il/2012/01/microsoftreportingwebformsreportviewer.html

Upvotes: 6

Related Questions