Home / Community & Support / Knowledge Base / Telerik Reporting / Designing Reports / How to use a Guid as value for report parameter or data source parameter?

How to use a Guid as value for report parameter or data source parameter?

Article Info

Rating: Not rated

Article information

Article relates to

 Telerik Reporting

Created by

 Steve, Telerik

Last modified

 March 12, 2011

Last modified by

 Steve, Telerik


PROBLEM
How to use a Guid as value for report parameter or data source parameter?

SOLUTION
Set the Type of the ReportParameter to String. Use the CStr(System.Object) built-in conversion function to convert the Guid to String for the ValueMember property of the report parameter AvailableValues.
When using Guid DataSourceParameter and its value is set to a ReportParameter, create an User Function to handle the conversion:
C#
public static Guid ConvertToGuid(string guid)
{
           return new Guid(guid);
}

VB.NET
Public Shared Function ConvertToGuid(guid As String) As Guid
    Return New Guid(guid)
End Function

and set the value for the DataSourceParameter:

= ConvertToGuid(Parameters.Parameter1.Value)

Comments

If you'd like to comment on this KB article, please, send us a Support Ticket.
Thank you!

Please Sign In to rate this article.