urgent help!!!

  • Thread starter Thread starter frien
  • Start date Start date
F

frien

I list parameters using a web service method GetReportParameters()...
i basically am using this method arond 8 times in my programme which is
making my programme work very very slow....is there any way .... i
could store the values once and use the same repitively.

the problem is based on the report name i list the parameters ...it
goes something like this

for(index = 0; index <listBoxReports.Items.Count)
{
parameters =_rs.getReportParameters(listBoxReports.Items[index].path,
null,null,true,null,null)
foreach(ReportParameter parameter in parameters)
{
------
-----
}

so i need a structure to store the name of the report and its
corresponding parameters...one report by report

Plz suggest me how do i go about.

Thanks a lost in advance
 
frien said:
I list parameters using a web service method GetReportParameters()...
i basically am using this method arond 8 times in my programme which is
making my programme work very very slow....is there any way .... i
could store the values once and use the same repitively.

the problem is based on the report name i list the parameters ...it
goes something like this

for(index = 0; index <listBoxReports.Items.Count)
{
parameters =_rs.getReportParameters(listBoxReports.Items[index].path,
null,null,true,null,null)
foreach(ReportParameter parameter in parameters)
{
------
-----
}

so i need a structure to store the name of the report and its
corresponding parameters...one report by report

Well, I'm not too well-versed in SQL Services Reporting, but assuming
that you get a new "parameters" structure back each time, you could
just store it in a hash table under the name of the report.

You could then do a "lazy lookup": look for the name of the report in
the Hashtable and, if you don't find it, go and get the report
parameters and cache them. Something like this:

private Hashtable _reportParametersCache = new Hashtable();

public ReportParameters GetReportParameters(string reportPath)
{
ReportParameters result =
(ReportParameters)this._reportParametersCache[reportPath];
if (result == null)
{
result
=_rs.getReportParameters(listBoxReports.Items[index].path, null, null,
true, null, null);
this._reportParametersCache[reportPath] = result;
}
return result;
}

If the parameters structure is not something you can store, then you'll
have to create a Hashtable (by report) of Hashtables (by parameter
name).

By the way, please don't title your posts "urgent help!!!". It's
extremely annoying. Use a title that says what you want to know: "How
to cache web service result?" (or something like that). That way people
who know about that area can read your post, and people who can't help
you can ignore it. People often ignore posts entitled "urgent help!!!"
on principle.
 
By the way, please don't title your posts "urgent help!!!". It's
extremely annoying. Use a title that says what you want to know: "How
to cache web service result?" (or something like that). That way people
who know about that area can read your post, and people who can't help
you can ignore it. People often ignore posts entitled "urgent help!!!"
on principle.

Yeah, when I post a question it's _always_ urgent - I really have to
restrain myself in the subject line....
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top