日期:2014-05-17  浏览次数:21009 次

急救:::::::RDLC报表问题:老是显示正在加载
环境:vs2012+windows server 2012



后台代码:

protected void Page_Load(object sender, EventArgs e)
        {           
            BLL.YUser bllUser = new BLL.YUser();
            this.ReportViewer1.LocalReport.ReportPath = "t1\\Report\\Report1.rdlc";
            this.ReportViewer1.LocalReport.DataSources.Add(new ReportDataSource("Test", bllUser.GetAllList().Tables[0]));
            this.ReportViewer1.LocalReport.Refresh();
        }


前台代码:

<form id="form1" runat="server">
        <asp:ScriptManager ID="ScriptManager1" runat="server"></asp:ScriptManager>
        <rsweb:ReportViewer ID="ReportViewer1" runat="server">
            
        </rsweb:ReportViewer>
        
    </form>


不知道为甚么会这样..

------解决方案--------------------
 BLL.YUser bllUser = new BLL.YUser();
            this.ReportViewer1.LocalReport.ReportPath = "t1\\Report\\Report1.rdlc";
            this.ReportViewer1.LocalReport.DataSources.Add(new ReportDataSource("Test", bllUser.GetAllList().Tables[0]));
            this.ReportViewer1.LocalReport.Refresh();
放到
 if (!IsPostBack)
{
}
里面试试