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