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

Now, you should set the UI.
1)Render format
2)OverWrite Mode
3)Report Parameter inputbox

#region Add Render Formats Control
  private void AddRenderFormats()
  {
   this.drp_RenderFormat.Items.Clear();
   Microsoft.ReportingServices.Interfaces.IDeliveryReportServerInformation IDelInfo = new WebUI.Reports.DeliveryReportInformation(rs.rs);
   foreach(Microsoft.ReportingServices.Interfaces.Extension IDelSet in IDelInfo.RenderingExtension)
   {
    if(IDelSet.Visible)
     this.drp_RenderFormat.Items.Add(new ListItem(IDelSet.LocalizedName,IDelSet.Name));
   }
  }
  #endregion

#region Add OverWrite Mode
  private void AddOverWriteModel()
  {
   this.rad_OverwriteOptions.Items.Add(new ListItem(GetMessage("Liter_OverWrite"),"OverWrite"));
   this.rad_OverwriteOptions.Items.Add(new ListItem(GetMessage("Liter_None"),"None"));
   this.rad_OverwriteOptions.Items.Add(new ListItem(GetMessage("Liter_AutoIncrement"),"AutoIncrement"));
   this.rad_OverwriteOptions.Items[2].Selected=true;
  }
  #endregion

#region AddParameterControl
  private void AddParameterControl()
  {
   ReportParameter[] rsParams = rs.GetReportParameters(this.txtReportName.Text);
   foreach(ReportParameter _rsParam in rsParams)
   {
    TableRow tr = new TableRow();
    TableCell tc= new TableCell();
    tc.Text=_rsParam.Prompt;
    
    TableCell tc2= new TableCell();
    TextBox tbx = new TextBox();
    tbx.ID=_paraCtlPrefix+_rsParam.Name;
    tbx.CssClass="text";
    tc2.Controls.Add(tbx);

    tr.Cells.Add(tc);
    tr.Cells.Add(tc2);
    this.tblParameters.Rows.Add(tr);
   }
  }
  #endregion

#region Get Report Params
  private ParameterValue[] GetReportParamsFromUI()
  {
   ArrayList alParams=new ArrayList();
   for(int i=0;i<Page.Request.Params.Count;i++)
   {
    if(Page.Request.Params.GetKey(i).IndexOf(_paraCtlPrefix)>-1)
    {
     ParameterValue _para=new ParameterValue();
     _para.Name=Page.Request.Params.GetKey(i).Replace(_paraCtlPrefix,string.Empty);
     _para.Value=Page.Request.Params.GetValues(i).GetValue(0).ToString();

     alParams.Add(_para);
    }
    if(Page.Request.Params.GetKey(i).Equals("ASP.NET_SessionId"))
     break;
   }
   ParameterValue[] _params=(ParameterValue[])alParams.ToArray(typeof(ParameterValue));
   return _params;
  }
  #endregion

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值