Subscription & Schedule handling on Reporting Services API (Part 1)

本文介绍了一个文件共享设置的配置方法,包括路径、文件名、用户名等详细参数设置,并提供了具体的代码实现。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

Base on scott, http://www.odetocode.com/Articles/114.aspx

#region FileShareSettings
  public Microsoft.ReportingServices.Interfaces.Setting[] FileShareSettings
  {
   get
   {
    Microsoft.ReportingServices.Interfaces.Setting[] intSettings = new Microsoft.ReportingServices.Interfaces.Setting[7];
    intSettings[0]=new Microsoft.ReportingServices.Interfaces.Setting();
    intSettings[0].Name="PATH";
    intSettings[0].Value=this.txt_Path.Text;

    intSettings[1]=new Microsoft.ReportingServices.Interfaces.Setting();
    intSettings[1].Name="FILENAME";
    intSettings[1].Value=string.Format("{0}-{1}-{2}",this.chk_IsPublic.Checked?Framework.Utility.DefaultAttribute.PUBLIC:this.CurrentUser.LogName,txtReportNo.Text,this.txt_FileName.Text);

    intSettings[2]=new Microsoft.ReportingServices.Interfaces.Setting(); //bool , auto add ext?
    intSettings[2].Name="FILEEXTN";
    intSettings[2].Value=this.chk_AddFileExtension.Checked.ToString(System.Globalization.CultureInfo.InvariantCulture);

    intSettings[3]=new Microsoft.ReportingServices.Interfaces.Setting();
    intSettings[3].Name="USERNAME";
    intSettings[3].Value=this.txt_UserNm.Text;

    intSettings[4]=new Microsoft.ReportingServices.Interfaces.Setting();
    intSettings[4].Name="PASSWORD";
    intSettings[4].Value=this.txt_Password.Text;

    intSettings[5]=new Microsoft.ReportingServices.Interfaces.Setting();//XML;CSV;IMAGE;PDF;HTML4.0;HTML3.2;MHTML;EXCEL
    intSettings[5].Name="RENDER_FORMAT";
    intSettings[5].Value=this.drp_RenderFormat.SelectedValue;

    intSettings[6]=new Microsoft.ReportingServices.Interfaces.Setting();//Overwrite;None;AutoIncrement
    intSettings[6].Name="WRITEMODE";
    intSettings[6].Value=this.rad_OverwriteOptions.SelectedValue;

    return intSettings;
   }
  }
  private ExtensionSettings BuildExtensionSettings(string deliveryExt, Microsoft.ReportingServices.Interfaces.Setting[] intSettings)
  {
   ExtensionSettings rsSettings = new ExtensionSettings();
   rsSettings.Extension = deliveryExt;//Name
   if (intSettings != null)
   {
    rsSettings.ParameterValues = new ParameterValue[intSettings.Length]; //declare ParameterValues
    for (int i = 0; i<intSettings.Length; i++)
    {
     ParameterValue paramValue = new ParameterValue();//Set each ParamValue
     paramValue.Name = intSettings[i].Name;
     paramValue.Value = intSettings[i].Value;
     rsSettings.ParameterValues[i] = paramValue;
    }
   }
   return rsSettings;
  }

  private void SetUIExtensionSettings(ExtensionSettings extSetting)
  {
   this.txt_Password.Text=string.Empty;
   foreach(ParameterValue paramValue in extSetting.ParameterValues)
   {
    switch(paramValue.Name)
    {
     case "PATH":
      this.txt_Path.Text=paramValue.Value;
      break;
     case "FILENAME"://band after reportNo
      if(paramValue.Value.IndexOf('-')>-1)
       this.txt_FileName.Text=paramValue.Value.Substring(paramValue.Value.IndexOf('-',paramValue.Value.IndexOf(this.txtReportNo.Text))+1);
      break;
     case "FILEEXTN":
      this.chk_AddFileExtension.Checked=Convert.ToBoolean(paramValue.Value);
      break;
     case "USERNAME":
      this.txt_UserNm.Text=paramValue.Value;
      break;
     case "RENDER_FORMAT":
      this.drp_RenderFormat.SelectedValue=paramValue.Value;
      break;
     case "WRITEMODE":
      this.rad_OverwriteOptions.SelectedValue=paramValue.Value;
      break;
    }
   }
  }
  #endregion

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值