Groups | Blog | Home
all groups > sql server reporting services > november 2004 >

sql server reporting services : How to get the value of a parameter programmatically


ALI-R
11/12/2004 7:12:19 PM
Hi,,

Say I have connected to the webs ervice and extracted all the parameters of
a particular report ,,how can I show the default bvalue of those parameter
if any????

thanks for your help,,here is my code:

ReportingService rs = new ReportingService(enviromental_Vars.LocalPath);

rs.Credentials = System.Net.CredentialCache.DefaultCredentials;

//string report =
this.cmbReports.Items[this.cmbReports.SelectedIndex].ToString();

bool forRendering = false;

string historyID = null;

ParameterValue[] values = null;

DataSourceCredentials[] credentials = null;

ReportParameter[] parameters = null;

try

{

parameters = rs.GetReportParameters(enviromental_Vars.ReportName, historyID,
forRendering, values, credentials);

if (parameters != null)

{



}

}

Scott Allen
11/13/2004 12:46:28 AM
There is a property on the ReportParameter class with the name of
DefaultValues, and of type string[].

You could use something along the lines of:

foreach(ReportParameter p in parameters)
{
string[] defaults = p.DefaultValues;

// work on defaults....

}

--
Scott
http://www.OdeToCode.com/blogs/scott/

On Fri, 12 Nov 2004 19:12:19 -0800, "ALI-R" <newbie@microsoft.com>
[quoted text, click to view]
AddThis Social Bookmark Button