This is a migrated thread and some comments may be shown as answers.

Q1 2010 Multivalue Parameter Issue

2 Answers 183 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Michael Love
Top achievements
Rank 1
Michael Love asked on 12 Mar 2010, 07:28 PM

Hi there.

I just upgraded to Q1 2010 and I am getting an error associated with any of my multivalue parameters.

Here is an example of the error: System.Exception: Invalid value of parameter 'Person'.

I am creating all of my parameters programmatically and if I change the parameter to multivalue = false, the report works fine. It seems like the changes associated with changing the UI object in the parameter structure while leaving it there temporarily for legacy purposes has caused an issue. Am I not initializing something (old or new) correctly?

See attached screenshot for Quick watch of created parameter.

Going to production soon! Any help is greatly appreciated.

Mike

Here is how I create/populate the parameter:

Telerik.Reporting.ReportParameter rp = new Telerik.Reporting.ReportParameter();   
 
if (drp.TelerikName != null && drp.TelerikName != "")   
{  
    rp.Name = drp.TelerikName;  
}  
else   
{  
    rp.Name = drp.Name;  
}  
 
rp.Type = drp.ParameterType;  
rp.UI.MultiValue = drp.MultiValue;  
 
// dont show any parameters on the viewer page   
rp.UI.Visible = false;   
 
if (rp.UI.MultiValue == true)   
{  
    if (rp.Value == null)   
    {  
        // Create new list   
        rp.Value = new ArrayList();   
    }  
        foreach (Pair valuePair in drp.ParameterValues)   
        {  
            if ((string)valuePair.First == drp.Name)  
            {  
                switch (rp.Type)   
                {  
                    case ReportParameterType.Integer:   
                    {  
                        ((ArrayList)rp.Value).Add(int.Parse(valuePair.Second.ToString()));  
 
                .....  
 

 

 

 

 

 

As I mentioned before, this worked fine in the previous release. It is still an array list which should be correct.

 

2 Answers, 1 is accepted

Sort by
0
Michael Love
Top achievements
Rank 1
answered on 13 Mar 2010, 04:55 AM
Trying to attach a file through 'Reply' as it won't work with 'Edit'
0
Milen | Product Manager @DX
Telerik team
answered on 16 Mar 2010, 03:55 PM
Hello Michael Love,

Since the new Telerik Reporting Q1 2010 version, when the report enters in the processing stage, report parameter values are validated against their validation properties (no matter if the parameter is visible or not). If one or more parameters do not have valid values, processing is aborted.

The validation properties include the type of the parameter, is it a single or multi-value, is its value among the available values (if such are defined), is null value allowed etc...

Your code snippet that generates the value is correct, but there is a slide issue with our validation logic and it accepts only long values (int values are not accepted). This will be addressed in our next internal release.

As a workaround you may provide values of type long in the ArrayList by using the long.Parse method instead of int.Parse method.

Thank you for bringing this to our attention. Your Telerik points have been updated as a token of gratitude.

Greetings,
Milen
the Telerik team

Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
Tags
General Discussions
Asked by
Michael Love
Top achievements
Rank 1
Answers by
Michael Love
Top achievements
Rank 1
Milen | Product Manager @DX
Telerik team
Share this question
or