I'm using the new Angular Report Viewer. My Component allows the user to change different parameters to generate the report. The first time the report runs, everything is fine. When a new set of parameters are selected, requesting the report still shows the report with the initial parameters.
In the prior version, I was able to get this to work by doing this in my ts file:
const v1 = $('#reportViewer1').data('telerik_ReportViewer');
Where requestedReportSource contained the new report parameters.
In the new TelerikReportViewerComponent, I see there' a setReportSource() method, but I'm unable to get the right JSON parameter format to be passed to the method.
Any examples on how to update the ReportSource for the component would be appreciated.
6 Answers, 1 is accepted
You can check the update in the support ticket #1110176 that you opened on the same question. For other members interested in this topic, below is the reply from the ticket:
"setReportSource method of the viewer can be used to update the report source as following:
This method expects a JSON object with report(string) and parameters(JSON) properties - Angular Report Viewer Methods."
Telerik by Progress
This comes up with the error
I didn't submit this post. It just appeared in email....
For anyone interested The following code was used to cast the reportSource object:
Thank you for bringing this issue to our attention. We consider this as a bug and it is already logged to our Public Feedback and Ideas portal on your behalf (Angular Report Viewer Report Source Update throws an error).
Thank you also for coming up with a possible workaround.