我真的没有搞乱SSRS - 但我的ASP.NET帽子告诉我你可能想把这些东西包装在一个if (!IsPostBack)
块中以防止它在页面刷新时运行.我的猜测是ReportViewer1.ServerReport.Refresh()
再次拉出默认值.
protected void Page_Load(object sender, EventArgs e) { if (!this.IsPostBack) { ReportViewer1.Width = 800; ReportViewer1.Height = 600; ReportViewer1.ProcessingMode = ProcessingMode.Remote; IReportServerCredentials irsc =new CustomReportCredentials("administrator", "MYpassworw", "domena"); ReportViewer1.ServerReport.ReportServerCredentials = irsc; ReportViewer1.ServerReport.ReportServerUrl = new Uri("http://192.168.0.1/ReportServer/"); ReportViewer1.ServerReport.ReportPath = "/autonarudzba/listanarudzbi"; ReportViewer1.ServerReport.Refresh(); } }