all groups > sql server reporting services > august 2004 >
You're in the

sql server reporting services

group:

How do I use SetReportParameters - example please


Re: How do I use SetReportParameters - example please Teo Lachev
8/12/2004 2:42:00 PM
sql server reporting services:
Si,

You don't need to call SetReportParameters before rendering the report.
SetReportParameters is if you want to programitically configure the report
parameters but in your case the report is already configured and uploaded.
Please see Daniel's reply to your first post. Your report path looks
suspicious.

--
Hope this helps.

----------------------------------------------
Teo Lachev, MCSD, MCT
Author: "Microsoft Reporting Services in Action"
http://www.prologika.com


[quoted text, click to view]

How do I use SetReportParameters - example please Si
8/12/2004 3:44:18 PM
Re my other post and hitting the 260 char limit on my params report, seems I
need to use SetReportParameters to programmatically set the params in the
report before I call it.

I've searched all over Google for any examples of using this call & found
nowt but others asking the same question and I can't quite work out how to
use it myself, anyone care to elaborate?

This is what I have so far but it's got holes in it so not working code atm:

private void SetOurReportParams(string report)
{
// see what params we need from our report
ReportParameter[] parameters = rs.GetReportParameters(report, null, false,
null, null);

if (parameters != null)
{
foreach (ReportParameter parameter in parameters)
{
if (parameter.Name == "DateFrom")
{
ReportParameter[] rp = new ReportParameter[1];

for (int i=0; i<rp.Length; i++)
{
rp[i] = new ReportParameter();
rp[i].ValidValues.SetValue(DateTime.Now, 0);
}
}
else if (parameter.Name == "DateTo")
{
ReportParameter[] rp = new ReportParameter[1];

for (int i=0; i<rp.Length; i++)
{
rp[i] = new ReportParameter();
rp[i].ValidValues.SetValue(DateTime.Now, 0);
}
}
}
rs.SetReportParameters(report, rp);
}
}


Si

Re: How do I use SetReportParameters - example please Si
8/13/2004 8:15:53 AM
Thanks Teo,

Just replied to my original post that Daniel commented on.

Cheers

Si

On Thu, 12 Aug 2004 14:42:00 -0400, "Teo Lachev"
[quoted text, click to view]
AddThis Social Bookmark Button