[RS]调用Web服务生成历史快照

需求:程序调用RS中的一个报表,产生历史快照

生成历史快照的方法

http://msdn.microsoft.com/library/en-us/RSPROG/htm/rsp_ref_soapapi_service_ak_7v5f.asp?frame=true

public string CreateReportHistorySnapshot(
   string
Report ,
   out [Namespace].Warning[] Warnings
);
参数说明:
Report : 报表的路径。比如访问报表的URL是http://xuzhong/ReportServer?/MyReports/Report1,那么报表的路径就是/MyReports/Report1。
Warnings : 当执行出错异常时,信息都会记在这里。

返回值 : 一个GTD时间格式的字符串,到时,你可以使用这个时间来访问这个报表的历史快照; http://xuzhong/ReportServer?/MyReports/Report1&rs:Snapshot=2005-08-09T09:06:03


遇到的问题

历史报表不能传递参数,所以需要寻找别的方法
http://support.microsoft.com/default.aspx?scid=kb;en-us;842854
中提到了关于使用历史快照的方法,但传参问题还是没有解决


一段简单的例子:
private void button1_Click(object sender, System.EventArgs e)
{
     ReportServerWebService.ReportingService rs = new ReportServerWebService.ReportingService();
     rs.Credentials = System.Net.CredentialCache.DefaultCredentials;
     ReportServerWebService.Warning[] arrWarning ;
     string resturl = rs.CreateReportHistorySnapshot( "/ReportServiceProject/xzLinkedReport1" , out arrWarning );
     textBox1.Text = resturl ;
}


文章来源:http://ms.mblogger.cn/xuzhong/posts/17264.aspx

posted on 2005-08-10 04:44  徐中  阅读(383)  评论(0编辑  收藏  举报

导航