水晶报表pull模式连接 解决登陆输入问题

来源:互联网 发布:智能电视与网络电视 编辑:程序博客网 时间:2024/05/17 03:03

       TableLogOnInfo logOnInfo = new TableLogOnInfo();
        //这里必须声明一个Reportdocument对象   Report,   同时加载数据报表  
        ReportDocument oRpt = new ReportDocument();
        oRpt.Load(Server.MapPath("CrystalReport.rpt"));

        //建立安全信息  
        logOnInfo.ConnectionInfo.ServerName = "FS02";
        logOnInfo.ConnectionInfo.DatabaseName = "ACData";
        logOnInfo.ConnectionInfo.UserID = "hins";
        logOnInfo.ConnectionInfo.Password = "12345";

        oRpt.Database.Tables[0].ApplyLogOnInfo(logOnInfo);

        //建立   .rpt   文件与   CryStalReportViewer   文件之间的连接  
        CrystalReportViewer1.ReportSource = oRpt;   

原创粉丝点击