How to use Guid as value for report parameter or data source parameter?
Environment
Product | Progress® Telerik® Reporting |
Description
The article explains how to use a Guid as value for report parameter or data source parameter.
Solution 1
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:
public static Guid ConvertToGuid(string guid)
{
return new Guid(guid);
}
Public Shared Function ConvertToGuid(guid As String) As Guid
Return New Guid(guid)
End Function
Finally, set the value for the DataSourceParameter:
= ConvertToGuid(Parameters.Parameter1.Value)
Solution 2
Convert the Guid value to a String value in the data-retrieval method, or add a calculated field to the data source component by using the CStr(System.Object) built-in conversion function to convert the Guid to String. Then, you can use the String report parameters directly.