Playing a sound from an SSRS Report

  • I have been tasked with trying to get a dashboard style SSRS report to play a sound.

    We have a report that is displayed on a large screen on our sales floor. It auto refreshes every 2 minutes. On there is a section for new deals that have been done - when the report reloads and a new deal has been posted a sound needs to be played to draw attention to the screen.

    I have done some research and it seems perhaps the only way is via some Javascript? I have had a play with inserting some basic test Javascript into a report and even that doesn't work!

    I added the following code to my report :


    Public Shared Function AlertMessage(Byval param AS String)  
    System.Web.HttpContext.Current.Response.Write("<script language='javascript'>alert('" & param &"');</script>")
    End Function

    And then this as the source of a text box :

    =Code. AlertMessage("Hello")

    And I get the following error :

    Sys.WebForms.PageRequestManagerParserErrorException: The message received from the server could not be parsed. Common causes for this error are when the response is modified by calls to Response.Write(), response filters, HttpModules, or server trace is enabled.Details: Error parsing near '<script language='ja'.

    So I guess my question is (a) has anyone successfully got sounds to play from within SSRS? and / or (b) if not how do I get any sort of Javascript (if that is to be the basis of my next steps) to run successfully?

    Thanks

  • cdh-727733 - Tuesday, June 5, 2018 4:11 AM

    I have been tasked with trying to get a dashboard style SSRS report to play a sound.

    We have a report that is displayed on a large screen on our sales floor. It auto refreshes every 2 minutes. On there is a section for new deals that have been done - when the report reloads and a new deal has been posted a sound needs to be played to draw attention to the screen.

    I have done some research and it seems perhaps the only way is via some Javascript? I have had a play with inserting some basic test Javascript into a report and even that doesn't work!

    I added the following code to my report :


    Public Shared Function AlertMessage(Byval param AS String)  
    System.Web.HttpContext.Current.Response.Write("<script language='javascript'>alert('" & param &"');</script>")
    End Function

    And then this as the source of a text box :

    =Code. AlertMessage("Hello")

    And I get the following error :

    Sys.WebForms.PageRequestManagerParserErrorException: The message received from the server could not be parsed. Common causes for this error are when the response is modified by calls to Response.Write(), response filters, HttpModules, or server trace is enabled.Details: Error parsing near '<script language='ja'.

    So I guess my question is (a) has anyone successfully got sounds to play from within SSRS? and / or (b) if not how do I get any sort of Javascript (if that is to be the basis of my next steps) to run successfully?

    Thanks

    Are you using the report viewer control? I've seen similar examples along the lines of this and they were all using the report viewer control. I think that may be the only way it would work. 

    Sue

  • Hi

    Currently it just renders in a browser - would be open to anything that works though as the sound is quite an important part of this.

    Thanks

  • cdh-727733 - Tuesday, June 5, 2018 2:35 PM

    Hi

    Currently it just renders in a browser - would be open to anything that works though as the sound is quite an important part of this.

    Thanks

    That explains why it won't parse. Do a search on: rdlc report viewer control
    That should get you going.

    Sue

  • Do you mean it will only work if the report viewer is used? I thought it rendered HTML so potentially a browser could be used? Is that the only way to get any javascript to work?

  • cdh-727733 - Wednesday, June 6, 2018 2:59 AM

    Do you mean it will only work if the report viewer is used? I thought it rendered HTML so potentially a browser could be used? Is that the only way to get any javascript to work?

    Some things will work but not everything and there are a lot of different caveats to using it. The audio ones I've seen that have actually worked were all using the report viewer control.
    You can certainly try - make sure to add a reference to system.web. 
    The only one I know to easily work is to open a url in another window as it's too basic to break and not embedding code.

    Sue

Viewing 6 posts - 1 through 5 (of 5 total)

You must be logged in to reply to this topic. Login to reply