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?

No comments:

Post a Comment