My Blazor application uses an API for all its data and reporting etc
In my _Host.cshtml I have the following line
@* For Reports service hosted in another application / Report Server use absolute URI: *@
<script src="https://localpc/localapi/api/reports/resources/js/telerikReportViewer"></script>
and the report views OK.
When this goes into production, the localpc/localapi will change, the API will be hosted on the customers server
So, without change my code and re-compiling can I make this variable / configurable?
Thanks
Hi Andrew,
There are a few options that you can test:
1. Refer to the JS file of the viewer relatively:
<script src="/api/reports/resources/js/telerikReportViewer"></script>
2. Refer the file locally. You can find it in the installation folder of Telerik Reporting and copy it to the folder with scripts in your project:
C:\Program Files (x86)\Progress\Telerik Reporting R1 2022\Html5\ReportViewer\js
3. Use JS variable to set the src attribute for <script> tag
Hi
I created a folder in the root of my blazor project and copied the js file into it as below...
then I modified my _Host.cshtml file as below..
All works OK as expected, thank you for the advice!
Hi Andrew,
Thank you for the update.
Only keep in mind that with each upgrade of Telerik Reporting, you need to paste the new version of the JavaScript file of the viewer to your scripts folder.