首先添加本地WebService的引用,地址是: http://localhost/ReportServer/ReportService.asmx引用,可以把这个地址设置为动态方便以后修改。
全部原代码如下:
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using System.Configuration;
using System.IO;
using System.Net;
using System.Web.Services;
using System.Web.Services.Protocols;
//using ReportServiceSetup.RS;
namespace UpdateReport
{
public partial class setup : Form
{
private byte[] definition = null;
private ReportServiceSetup.ReportingService rs = new ReportServiceSetup.ReportingService();
private string ServerIP = "";
private string SqlUserName = "";
private string sqlPassword = "";
private string filePath = @"f:\xyq\Report\";//报表存放路径
//private Warning[] warn = null;
public setup()
{
InitializeComponent();
ServerIP = this.TxtReportIP.Text;//数据库服务器ip
SqlUserName = this.TxtUserName.Text;//数据库服务器登陆名
sqlPassword = this.TxtPassWord.Text;//数据库服务器登陆密码
}