Hi,
I have created a Parameter in my report which is a GUID called @ProjId
if I try to pass a value into it, I get a variety of errors as follows
If I pass in the GUID in any of these formats
f2ae04b3-ef47-4030-b897-4b005a523e7f
'f2ae04b3-ef47-4030-b897-4b005a523e7f'
{f2ae04b3-ef47-4030-b897-4b005a523e7f}
I get 'Input string was not in the correct format' followed by 'Failed to convert a parameter value from string to a guid.'
However if I embed the value into the report query directly inside single quotes, i.e;
WHERE ProjectId = 'f2ae04b3-ef47-4030-b897-4b005a523e7f'
The report executes as expected. SO my question is, how do I pass a GUID into a parameter?
Thanks,
Jon.
Parameters & UniqueIdentifiers
Parameters & UniqueIdentifiers
Hello, Jellis.
Please try the following expression:
P.S. For declaring of the variable with this sort of initializing please use Guid(Nullable) datatype.
Thank you.
Please try the following expression:
Code: Select all
new Guid("f2ae04b3-ef47-4030-b897-4b005a523e7f");
Thank you.
Parameters & UniqueIdentifiers
Thanks Edward.
I actually achieved what I wanted by using a variable in my SQL statement and passing a value into that. Is there any advantage in using variables or parameters? They both seem to achieve the same thing?
Jon.
I actually achieved what I wanted by using a variable in my SQL statement and passing a value into that. Is there any advantage in using variables or parameters? They both seem to achieve the same thing?
Jon.
Parameters & UniqueIdentifiers
Hello, Jon.
In that case can be used variables as well as parameters. Meaning is the same. But assigning of the variables is possible outside the report from the main application, when the DataSource object is not created, but you need to assign a value.
Thank you.
In that case can be used variables as well as parameters. Meaning is the same. But assigning of the variables is possible outside the report from the main application, when the DataSource object is not created, but you need to assign a value.
Thank you.