当前位置:  开发笔记 > 编程语言 > 正文

将凭据传递给Sql Report Server 2008

如何解决《将凭据传递给SqlReportServer2008》经验,为你挑选了1个好方法。



1> Mark Bracket..:

我真的没有搞乱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();
    }
}


ReportViewer1.ServerReport.ReportServerCredentials没有setter
推荐阅读
wangtao
这个屌丝很懒,什么也没留下!
DevBox开发工具箱 | 专业的在线开发工具网站    京公网安备 11010802040832号  |  京ICP备19059560号-6
Copyright © 1998 - 2020 DevBox.CN. All Rights Reserved devBox.cn 开发工具箱 版权所有