zoukankan      html  css  js  c++  java
  • Reporting Services系列五:WebService接口

    ReportingServices提供WebService接口,基本上所有报表的操作都可以利用它们完成,以下在代码演示如何使用它们进行报表的导出、报表的订阅等。其中报表订阅中的邮件订阅未经过实际测试,其它代码都经过测试,没有发现什么问题。当然方法只是给出个原理,没有什么真正实用价值,有兴趣的人可以根据自己的需求对接口进行包装。

    在动手写代码之前,你要添加对此WebService的引用,如图:

    //

    代码如下:

    测试代码:


            
    private void btExp_Click(object sender, System.EventArgs e)
            
    {
                RsWebServiceHelper h
    =new RsWebServiceHelper();
                
    string[][] pv=new string[4][];
                pv[
    0]=new string[2]{"start_time","2007-02-01"};
                pv[
    1]=new string[2]{"end_time","2007-03-01"};
                pv[
    2]=new string[2]{"note","20"};
                pv[
    3]=new string[2]{"RsName","Alarm"};
                
    bool rt=h.ExportReport("/pReports/AlarmLevel",pv,"Excel",@"e:\myhuang\rs.xls");
                
    if(rt)
                
    {
                    Response.Write(
    "<script language=javascript>window.alert('ok');</script>");
                }

                
    else
                
    {
                    Response.Write(
    "<script language=javascript>window.alert('failed');</script>");
                }

            }


            
    private void btSubs_Click(object sender, System.EventArgs e)
            
    {
                
    string[][] pv=new string[4][];
                pv[
    0]=new string[2]{"start_time","2007-02-01"};
                pv[
    1]=new string[2]{"end_time","2007-03-01"};
                pv[
    2]=new string[2]{"note","20"};
                pv[
    3]=new string[2]{"RsName","Alarm"};

                RsWebServiceHelper h
    =new RsWebServiceHelper();
                
    string rtout;
                
    bool rt=h.SubscriptionFileShare("/pReports/AlarmLevel",pv,DateTime.Now.AddMinutes(1),"subsnew",@"e:\myhuang\RsShareFolder","EXCEL","myhuang","123",out rtout);
                
    if(rt)
                
    {
                    Response.Write(
    "<script language=javascript>window.alert('succeed:"+rtout+"');</script>");
                }

                
    else
                
    {
                    Response.Write(
    "<script language=javascript>window.alert('error:"+rtout+"');</script>");
                }

            }

  • 相关阅读:
    【BZOJ 3098】 Hash Killer II
    【BZOJ 1189】[HNOI2007]紧急疏散evacuate
    【BZOJ 1088】 [SCOI2005]扫雷Mine
    【BZOJ 1821】 [JSOI2010]Group 部落划分 Group
    【BZOJ 1013】 [JSOI2008]球形空间产生器sphere
    【BZOJ 1084】[SCOI2005]最大子矩阵
    【BZOJ 1085】 [SCOI2005]骑士精神
    JNday6-pm
    JNday6-am
    JNday5-pm
  • 原文地址:https://www.cnblogs.com/morvenhuang/p/839548.html
Copyright © 2011-2022 走看看