hi! we have a browser client that let you invoke a report and show it in the browser automatically, you can use that instead of writing your own logic to do it. if you are still curious of how to do it on your own you can take a look at the source code of browser client
Looks like your connection to jsreport forum was lost, please wait while we try to reconnect.