2 years ago

#36178

test-img

Hölderlin

Execute cutom javascript in report server

I followed this blog to insert custom javascript into my report.

  1. I open report properties and referenced the library "C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework.NETFramework\v4.7.2\System.Web.dll". enter image description here

  2. I copied System.Web.dll to "\Program Files\Microsoft SQL Server\MSRS13.MSSQLSERVER\Reporting Services\ReportServer\bin"

  3. Under report properties > code I add the function:

    Function WriteHTML (ByVal Msg AS String) AS String
    System.Web.HttpContext.Current.Response.Write(Msg)
    Return “”
    End Function
    
  4. Inserted a hidden textbox to the report and set expression to:

    Code.WriteHTML("<script> console.log('hello world');</script>")
    

5 ) I deployed the report without any error.

But if I run the report in the browser no output is written to browser console. Any suggestions, do I miss something? Do I have to edit the rssrvpolicy.config as it mentioned here under point 3?

I found a second tutorial which describes an other method to execute a custom script in your report. But in my case I can't find any js file under "\Program Files\Microsoft SQL Server\MSRS13.MSSQLSERVER".

sql-server

reporting-services

reportbuilder

0 Answers

Your Answer

Accepted video resources