Hi there,
I have an issue with passing parameters through to a report using Blazor C#. Normally I can pass my parameters through fine, however, I have found when a second parameter is a Dataset that relies on the first parameter, its value is not being respected.
For instance, I have 2 parameters: UserID and Location. UserID has a default of 123 set on it, but should be set externally when the report is run. Location uses a dataset query to get its values, and the query it uses relies on UserID.
The query is:
SELECT L.ID AS Value
, FL.Description AS Label
FROM Location L
INNER JOIN [dbo].[Get_F_Location](@UserID) FL ON L.ID = FL.ID
ORDER BY label
When I run the query locally with my correct UserID I get 100 records back. When I run it using c#, I only get 5 records back, because it is using the default UserID value of "123", not the value I have passed in.
I have tried setting the parameter in a few places to force it to work, and cannot figure it out.
In the client code (.razor.cs) before we call the BoldReports javascript
In the BoldReportsController.OnReportLoaded()
And in the BoldReportsController.OnInitReportOptions()
None of these work.
However, if I set Hidden=false, I could see that the 789 was displayed in the UI, so the value is definitely getting set. So I think my problem is that I'm not setting it early enough to stop Location being calculated prior to me sending the parameter.
Do you know how I can resolve this?
Thanks in advance.
Stu