Showing posts with label processing. Show all posts
Showing posts with label processing. Show all posts

Thursday, March 8, 2012

Caching in TimeSeries

Hi,

I have prepared a time series model. The model works well with few cases. Answering time raises extremly after processing the model with all cases.

In a book I read sth. about a cahing possibilty. But how can this be defined in Visual Studio ?

Thanks in advance
Achim

Since the time series algorithm does not do predictions on new input data (it uses the historical data that the model was trained with), it returns the same result each time you request a prediction for the next N steps, for a given N. You can take advantage of this by getting the results for the maximum number of steps you're likely to request in one query, saving the results on the client (in an in-memory list or on disk) and then using the saved results for future requests against that model instead of sending the prediction query to the server. You would only need to refresh the cached results if the model gets reprocessed with new data.|||

The algorithm has a certain built in mechanism for caching. For instance, if you ask for the next 50 forecasted values, the first query will be relatively slow. Subsequent queries for less than 50 values should be much faster. However, asking for the first time for 51 values will also take a longer time.

Friday, February 10, 2012

bumb, Any help anyone?

I need help about this , What i've done so far is a data processing extension that gets its data from a WS , I use it as a datasource for a report , That report will be displayed withing an ASPX page containing a reportviewer control that displays that report , The problem is catching errors that occurs withing the data processing extension .. ,

When i debugged the extension i saw that after throwing an exception the code ends up inside the "cancel()" event inside the IDBcommand implementation...

In all examples for a data processing extension i could find online they always have a comment saying the cancel is not implemented and throw a NewUnsupportedExtension()..

What happens is i get some uninformative , non-userfriendly error from the reporting services ,
something like "an error occurred during the report processing(rssomehing)"

How should i go about handling those exception that happened inside the data processing extension?

I've tried catching the error inside the event of the reportviewercontrol - reporterror but it seems that event don't fire when those errors are generated..

Any help on how to approach this would be highly welcome

......|||

After further thinking and consulting I've maybe determined? The only way to handle these errors is to somehow pass the errors to the report for display , While returning an empty dataset as the value for the report fields .

I've done that and for the error i was thinking to pass the error as a parameter in the forum ( I can't use the dataset since i only get the column names from the ws and if there is an error there i don't have it )

So i'm trying to pass the value of the error through a "dummy" parameter named Error , i created it on the report and used the following code iside the data processing extension :

added this class

public class DataParameter : IDataParameter
{
string m_paramName;
object m_value;

public DataParameter()
{
}

public DataParameter(string parameterName, object value)
{
m_paramName = parameterName;
this.Value = value;
// Setting the value also infers the type
}

public String ParameterName
{
get { return m_paramName; }
set { m_paramName = value; }
}

public object Value
{
get
{
return m_value;
}
set
{
m_value = value;
}
}
}

And inside the command.cs in the data processing extension i have this code

string strError = "My error messege" ;

IDataParameter idpError = new DataParameter ( "Error", strError );

_parameters.add ( idpError);

And thats it , The problem is i always get the default parameter value..

Any ideas why is that / An alternative solution to the entire problem or to passing the error message to the report(not by a parameter..? ).

|||

Hi there,

Could it be that the parameter name requires a @. before it? Sounds too simple. Can you explore the parameters in the report, and rather than explicitly setting them reference them by ordinal?

If you can send me the code I may be able to look at it this week, as we are doing something similar.

cheers,

Andrew

|||

Andrew Sears - T4G wrote:

Hi there,

Could it be that the parameter name requires a @. before it? Sounds too simple. Can you explore the parameters in the report, and rather than explicitly setting them reference them by ordinal?

If you can send me the code I may be able to look at it this week, as we are doing something similar.

cheers,

Andrew

Hi Andrew ! Thanks for the quick response...

Hmmz about the @. , I will try it ..

I wanna point out that i'm rather new to reporting services so its the first time i hear of @. in front of a parameter can you give more details on when that should be added ? I will try to add it anyway and see if it help..

Regarding exploring the parameters i tried to look for a way of doing that inside the data extension and didn't find , If you have a sample code for doing that would be helpfull...

I will try sending you the code altough it can be a bit problematic since some of it is classified so i will need to edit it quite a bit before sending , Another alternative is if you might be able to send me a sample of what your doing , If its similar then i'm sure it can help me..

Thanks alot anyway..

Idan Hollander

|||

Hi there,

Have you seen this article?

http://weblogs.asp.net/gavinjoyce/archive/2004/01/29/64339.aspx

cheers,

Andrew

|||Thank you very much but i'm afraid the link to the code there is not working..|||

After reading the comments on that article (but didn't see the code since the link isn't working ) I think it is not what i'm looking for

And correct me if i'm wrong but from what i understand in that DPE he was passing values of the paramater from the user/gui(parameter selection) to the DPE ( commandtext = parameter.value.. ? )

What i'm trying to do is pass a paramater from the DPE to the report , Meaning setting a parameter value by using the code inside the DPE.

Is that even possible? Or am i doing something wrong in code?

bumb, Any help anyone?

I need help about this , What i've done so far is a data processing extension that gets its data from a WS , I use it as a datasource for a report , That report will be displayed withing an ASPX page containing a reportviewer control that displays that report , The problem is catching errors that occurs withing the data processing extension .. ,

When i debugged the extension i saw that after throwing an exception the code ends up inside the "cancel()" event inside the IDBcommand implementation...

In all examples for a data processing extension i could find online they always have a comment saying the cancel is not implemented and throw a NewUnsupportedExtension()..

What happens is i get some uninformative , non-userfriendly error from the reporting services ,
something like "an error occurred during the report processing(rssomehing)"

How should i go about handling those exception that happened inside the data processing extension?

I've tried catching the error inside the event of the reportviewercontrol - reporterror but it seems that event don't fire when those errors are generated..

Any help on how to approach this would be highly welcome

......|||

After further thinking and consulting I've maybe determined? The only way to handle these errors is to somehow pass the errors to the report for display , While returning an empty dataset as the value for the report fields .

I've done that and for the error i was thinking to pass the error as a parameter in the forum ( I can't use the dataset since i only get the column names from the ws and if there is an error there i don't have it )

So i'm trying to pass the value of the error through a "dummy" parameter named Error , i created it on the report and used the following code iside the data processing extension :

added this class

public class DataParameter : IDataParameter
{
string m_paramName;
object m_value;

public DataParameter()
{
}

public DataParameter(string parameterName, object value)
{
m_paramName = parameterName;
this.Value = value;
// Setting the value also infers the type
}

public String ParameterName
{
get { return m_paramName; }
set { m_paramName = value; }
}

public object Value
{
get
{
return m_value;
}
set
{
m_value = value;
}
}
}

And inside the command.cs in the data processing extension i have this code

string strError = "My error messege" ;

IDataParameter idpError = new DataParameter ( "Error", strError );

_parameters.add ( idpError);

And thats it , The problem is i always get the default parameter value..

Any ideas why is that / An alternative solution to the entire problem or to passing the error message to the report(not by a parameter..? ).

|||

Hi there,

Could it be that the parameter name requires a @. before it? Sounds too simple. Can you explore the parameters in the report, and rather than explicitly setting them reference them by ordinal?

If you can send me the code I may be able to look at it this week, as we are doing something similar.

cheers,

Andrew

|||

Andrew Sears - T4G wrote:

Hi there,

Could it be that the parameter name requires a @. before it? Sounds too simple. Can you explore the parameters in the report, and rather than explicitly setting them reference them by ordinal?

If you can send me the code I may be able to look at it this week, as we are doing something similar.

cheers,

Andrew

Hi Andrew ! Thanks for the quick response...

Hmmz about the @. , I will try it ..

I wanna point out that i'm rather new to reporting services so its the first time i hear of @. in front of a parameter can you give more details on when that should be added ? I will try to add it anyway and see if it help..

Regarding exploring the parameters i tried to look for a way of doing that inside the data extension and didn't find , If you have a sample code for doing that would be helpfull...

I will try sending you the code altough it can be a bit problematic since some of it is classified so i will need to edit it quite a bit before sending , Another alternative is if you might be able to send me a sample of what your doing , If its similar then i'm sure it can help me..

Thanks alot anyway..

Idan Hollander

|||

Hi there,

Have you seen this article?

http://weblogs.asp.net/gavinjoyce/archive/2004/01/29/64339.aspx

cheers,

Andrew

|||Thank you very much but i'm afraid the link to the code there is not working..|||

After reading the comments on that article (but didn't see the code since the link isn't working ) I think it is not what i'm looking for

And correct me if i'm wrong but from what i understand in that DPE he was passing values of the paramater from the user/gui(parameter selection) to the DPE ( commandtext = parameter.value.. ? )

What i'm trying to do is pass a paramater from the DPE to the report , Meaning setting a parameter value by using the code inside the DPE.

Is that even possible? Or am i doing something wrong in code?