“The report definition for report 'xxx' has not been specified.”

前端 未结 3 1551
无人共我
无人共我 2021-01-20 16:43

I\'m trying out SSRS for the first time with an ASP.Net web form.

I created a local RDLC report and used a ReportViewer in the \"Default\" web form. Under the smart

相关标签:
3条回答
  • 2021-01-20 17:04

    This happens when you deploy in live site and report's .rdlc file is not yet published in the site, so here is the solution which worked form me:

    1. Right click on your Report's '.rdlc' file , select properties then set the property Build Action of the rdlc to Content.

    Screen Shot:

    Reference:

    This and This

    Hope that helps.

    0 讨论(0)
  • 2021-01-20 17:10

    Okay, so it looks like you are missing your ReportPath in your local report. Here is a code example straight from my working project.

    <body class="center">
        <form id="form1" runat="server">
            <div>
                <asp:ScriptManager ID="ScriptManager1" runat="server"></asp:ScriptManager>
                <asp:Label ID="lblCheckDate" runat="server" Visible="False"></asp:Label>
                <rsweb:ReportViewer ID="ReportViewer1" runat="server" Font-Names="Verdana" Font-Size="8pt" WaitMessageFont-Names="Verdana" WaitMessageFont-Size="14pt" Height="800px" Width="620px" CssClass="center" BackColor="White" ShowBackButton="False" ShowPageNavigationControls="False">
                    <LocalReport ReportPath="Paystub.rdlc" ReportEmbeddedResource="PayrollApplication.Paystub.rdlc">
                        <DataSources>
                            <rsweb:ReportDataSource DataSourceId="SqlDataSource1" Name="DataSet1" />
                        </DataSources>
                    </LocalReport>
                </rsweb:ReportViewer>
                <asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="<%$ ConnectionStrings:pay %>"
                    SelectCommand="SELECT * FROM [ViewPaychecks] WHERE ([CHKDATE] = @CHKDATE)">
                    <SelectParameters>
                        <asp:ControlParameter ControlID="lblCheckDate" Name="CHKDATE" PropertyName="Text" Type="String" />
                    </SelectParameters>
                </asp:SqlDataSource>
            </div>
        </form>
    </body>
    

    Let me know if this helped! I used an SqlDataSource but this should work with the ObjectDataSource as well.

    0 讨论(0)
  • 2021-01-20 17:18

    I had a the same error message and resolved it by adding the following two (2) lines at the end of the report definition:

    ReportViewer1.LocalReport.Refresh()
    ReportViewer1.RefreshReport()
    
    0 讨论(0)
提交回复
热议问题