我是第一次使用ASP.Net网络表格尝试SSRS。
我创建了一个本地RDLC报告,并在“默认”Web表单中使用了ReportViewer。在智能标签下,我选择了“选择报告”并选择了RDLC报告。
当我按f5运行报告时,即使我从智能标记中选择了报告,也会显示以下错误。
"The report definition for report 'xxx' has not been specified."
请让我知道为什么这不能按预期工作。
感谢。
报告编码:
<asp:Content runat="server" ID="FeaturedContent" ContentPlaceHolderID="FeaturedContent">
<section class="featured">
<div class="content-wrapper">
<hgroup class="title">
<h1><%: Title %>.</h1>
<h2>Modify this template to jump-start your ASP.NET application.</h2>
</hgroup>
<p>
To learn more about ASP.NET, visit <a href="http://asp.net" title="ASP.NET Website">http://asp.net</a>.
The page features <mark>videos, tutorials, and samples</mark> to help you get the most from ASP.NET.
If you have any questions about ASP.NET visit <a href="http://forums.asp.net/18.aspx" title="ASP.NET Forum">our forums</a>.
</p>
</div>
</section>
</asp:Content>
<asp:Content runat="server" ID="BodyContent" ContentPlaceHolderID="MainContent">
<rsweb:ReportViewer ID="ReportViewer1" runat="server" Font-Names="Verdana" Font-Size="8pt" WaitMessageFont-Names="Verdana" WaitMessageFont-Size="14pt" Width="739px">
<LocalReport ReportEmbeddedResource="WebApplicationFirstReports.Web Products.rdlc">
<DataSources>
<rsweb:ReportDataSource DataSourceId="ObjectDataSource1" Name="DataSet1" />
</DataSources>
</LocalReport>
</rsweb:ReportViewer>
<asp:ObjectDataSource ID="ObjectDataSource1" runat="server" SelectMethod="GetData" TypeName="DataSetWebTableAdapters.DataTable1TableAdapter"></asp:ObjectDataSource>
</asp:Content>
答案 0 :(得分:6)
好的,您的本地报告中似乎缺少ReportPath。以下是我工作项目的代码示例。
<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>
如果这有帮助,请告诉我!我使用了SqlDataSource,但这也适用于ObjectDataSource。
答案 1 :(得分:3)
当您在实际网站中部署并且报告的.rdlc
文件尚未在网站上发布时会发生这种情况,因此这里的解决方案对我有用:
答案 2 :(得分:0)
我有一个相同的错误消息,并通过在报告定义的末尾添加以下两(2)行来解决它:
frame