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

using GUID type for valuemember in reportparameter

2 Answers 195 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
katja purrazzo
Top achievements
Rank 1
katja purrazzo asked on 03 Feb 2010, 10:59 PM
Hi
I have a report with a report paramter set with the following properties

Name=myparameter
type= string
available values:
        datasource= (mybusinessobject)
      displaymember=lastname
      valuemember=ID
multivalue=true


The valuemember ID is of type System.Guid. Executing the report I get the message:
availablevalue for parameter myparamter should be of type string.invalid value.

how can I use guid??

2 Answers, 1 is accepted

Sort by
0
Russell Damske
Top achievements
Rank 1
answered on 15 Feb 2011, 05:49 PM
I am running into the same problem. Is there a solution??
0
Peter
Telerik team
answered on 16 Feb 2011, 10:01 AM
Hi guys,

The Report Parameters Type property is used to give the report engine guidance which editor (UI) to render for the specified parameter. You can easily convert the input and output values to any type with an embedded Functions and an User Function such as the following one:

public static Guid ConvertToGUID(object guid)
{
    return new Guid(guid.ToString());
}

To convert the Guid to String for the ReportParameter.AvailableValues.DisplayMember and ValueMember properties you can use the CStr(System.Object) function that converts an expression to string value.

Regards,
Peter
the Telerik team
Get started with Telerik Reporting with numerous videos and detailed documentation.
Tags
General Discussions
Asked by
katja purrazzo
Top achievements
Rank 1
Answers by
Russell Damske
Top achievements
Rank 1
Peter
Telerik team
Share this question
or