.net环境下新建的web项目,页面里只添加一个ReportViewer,设置好数据源后可以正常显示,但在页面里再加任何其他控件后ReportViewer就不能显示了,也没有报错。请高手指点。
这里是页面代码
1 <%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="_Default" %> 2 3 <%@ Register Assembly="Microsoft.ReportViewer.WebForms, Version=11.0.0.0, Culture=neutral, PublicKeyToken=89845dcd8080cc91" Namespace="Microsoft.Reporting.WebForms" TagPrefix="rsweb" %> 4 5 <!DOCTYPE html> 6 7 <html xmlns="http://www.w3.org/1999/xhtml"> 8 <head runat="server"> 9 <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/> 10 <title></title> 11 </head> 12 Code 13 <body> 14 15 <form id="form1" runat="server"> 16 <asp:ScriptManager ID="ScriptManager1" runat="server"> 17 </asp:ScriptManager> 18 <asp:TextBox ID="TextBox1" runat="server"></asp:TextBox> 19 <asp:Button ID="Button1" runat="server" OnClick="Button1_Click" Text="View Report" /> 20 <rsweb:ReportViewer ID="ReportViewer1" runat="server" Font-Names="Verdana" Font-Size="8pt" BackColor="#FF6600" 21 > 22 <LocalReport ReportPath="Report.rdlc" > 23 <DataSources> 24 <rsweb:ReportDataSource DataSourceId="ObjectDataSource1" Name="DataSet1" /> 25 </DataSources> 26 </LocalReport> 27 </rsweb:ReportViewer> 28 </form> 29 30 </body> 31 </html>