Good morning. I'm having problems that i can't get over with the ReportViewer for WPF. I created a report for which i need to set the values of some parameters and that i have to display when the window opens without the need of user interaction. I set the parameters in the following way:
Load the report by setting the ReportPath on the control
Obtain the parameters using the GetParameters method (When closing the window i create a file with the name of the parameter and value set by the user to be able to reopen the report with the last values set)
Create a new parameter list with the desired values (including a hidden parameter set directly without the possibility of user modification)
Pass the list using the SetParameters method
Call the RefreshReport method
With this procedure the report is loaded correctly but to view it the user must press the "View Report" button. I looked for a way to immediately show the report without having to press the button and the only way i could find was to call the RefreshReport method twice in a row but doing so the report is displayed correctly only a few times, often it is displayed wrong or it is not displayed at all with exceptions loading it.
If the report is displayed by pressing the button without the consecutive calls of the method it is always displayed correctly but i need to show it directly without user interaction, is there a way to get the desired behavior?
VSVinoth Srinivasan Syncfusion Team April 24, 2019 04:54 AM
Thanks for your interest in Syncfusion Components.
We have validated your reported scenario and we suspect that the problem occurs when you are specifying value for the parameter before report has been loaded. So, we suggest you set parameters in “ReportLoaded” event. We have prepared a simple report viewer sample based on your requirement and it can be downloaded from the below location.