Displaying a Pop-up message in SSRS 2005

  • Comments posted to this topic are about the item Displaying a Pop-up message in SSRS 2005

    §§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§

    always Happy, always Prasanna 🙂

  • Does the pop-up message (not the text box) works when the report is deployed on the Reporting Server?

  • Hi,

    I am not able to get it to work on my ReportServer. It reports "Error during processing of ‘IsvalidNumber’ report parameter. (rsReportParameterProcessingError)" error. Any idea?

    Thanks, Jirka

  • I tried to achieve this some days ago. The problem here is when you are at the VS IDE the VB.NET code works fine. When the report is running on the Report Server it can't understand the VB.NET code as it runs in the Reporting Service environment. I wish there could be a way to embed some Javascript code into a report (as the report runs in the web environment) to achieve this. But I don't think it is possible at present.

  • Just tried but failed. Throws some invalid error - rsReportParameterProcessingError. Don't know what the heck is that.

    'm not a .Net developer.

    SQL DBA.

  • Unfortunately, I still can't find a resolution of the problem. Step by step debbuging shows me that the issue is related to the MsgBox function. I tried to add a refence to assembly Microsoft.VisualBasic (Microsoft.VisualBasic.dll), but it doesn't help.

    J.

  • Interesting article. I thought I could put it to some good use. I tried to apply this to a report where I need to check that two sets fo date parameters are in "synch" with each other. The code works, and the pop-up appears, but clicking NO (or in this case cancel) I need it to halt the report & go back to the initial parameters screen. I figgure that I need to ad some code between lines 14 and 15 that will halt the report. How do I do that?

    Here is my code:

    1Function CheckParams () as Boolean

    2Dim prompt as String

    3 Dim usrResponse As MsgBoxResult

    4prompt = ""

    5 usrResponse = MsgBoxResult.No

    6 If ((Report.Parameters!FromDate.Value <= Report.Parameters!CDEFromDate.Value) or (Report.Parameters!ToDate.Value <= Report.Parameters!CDEToDate.Value)) Then

    7 prompt = "You entered date ranges that are out of synch. Are you sure you want to continue?"

    8 End If

    9

    10If prompt "" Then

    11usrResponse = MsgBox(prompt,4,"Parameter out of scope" )

    12If usrResponse = MsgBoxResult.Yes Then

    13Return TRUE

    14Else

    15Return FALSE

    16End If

    17Else

    18Return TRUE

    19End If

    20End Function

  • sorry guys if it did not work for you. I will have to get back to you guys at a later date after I get a chance to look at it. But the screen shots are from actually running the report, so I know it works.

    But glad to see at least one person who could make use of this trick.

    Peter.Groman,

    As I mentioned in the article, SSRS 2005 really has lots of limitation but it is not that there are no workarounds. You cannot actually halt the report processing, because this validation occurs after you run the report. So here is what you can do...

    When user clicks No or Cancel, the give code returns a boolean "False". So based on this value, you can display a message in the report body, inside a textbox or label, asking users to enter the parameters again or whatever message you want.

    You will actually be altering the visible/Hidden property of your entire table or matrix or whatever controls you have in your report to hide when that parameter value is false and in that case you will show your textbox or label with message and hide this message when True.

    This should solve your problem. Let me know if this was not clear.

    - Prasanna:-)

    §§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§

    always Happy, always Prasanna 🙂

  • This sample doesn't work.

    The MsgBox function cause report process failed

    An error occurred during local processing IsValidNum

  • Hi Prassanna,

    Thanks for the post. It is not working as desired way. I expect the report to stop running when the user clicks on cancle button. Specificaly I want the call to db should not happen when the user hits cancle button.

    Using the hidden function we can be smart enough to hide data from user, but internally the db call should also be seized. Until the user selects the expected parameter, the report should not process (the call to db should nt happen).

  • Hi Prasanna,

    Thanks for the post. It is not working as desired way. I expect the report to stop running when the user clicks on cancle button. Specificaly I want the call to db should not happen when the user hits cancle button.

    Using the hidden function we can be smart enough to hide data from user, but internally the db call should also be seized. Until the user selects the expected parameter, the report should not process (the call to db should nt happen).

  • Hi Prasanna,

    Thanks for the post. It is not working as desired way. I expect the report to stop running when the user clicks on cancle button. Specificaly I want the call to db should not happen when the user hits cancle button.

    Using the hidden function we can be smart enough to hide data from user, but internally the db call should also be seized. Until the user selects the expected parameter, the report should not process (the call to db should nt happen).

  • It is not possible to stop the call to db after you run the report. The possible work around could be, in you dataset you can check the value of this parameter and execute stored procedures only if the parameter returns true, else you can execute simple select to return some static value. this will prevent your call to db and hidden function can present the report as if the report never executed.

    Hope this helps !!

    For those of you it did not work, can you may be give more information as to what you are trying to do, are you copying the code exactly, or making any changes? I am suprised because I tested everything before I included in the note.

    - Prasanna

    §§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§

    always Happy, always Prasanna 🙂

  • Hi and thanks for an interesting and promising article,

    However I'm having the same problem as many other of your readers. I've made a very simple report which is just supposed to show a messagebox and then show the report.

    I always get this message: Error during processing of ‘YesNoBox’ report parameter. (rsReportParameterProcessingError)

    when running it from Report Server.

    But when running it from BIDS it works OK. Is it Internet Explorer that blocks something?

    I attached the RDL-file I'm using.

    Best regards

    Jorgen Hasselgren

    HNO3 Business Intelligence Sweden

    2.5cm

    2.5cm

    21cm

    Integer

    =Code.testing(1)

    true

    Report_Parameter_5

    true

    true

    21cm

    0.25cm

    true

    1cm

    3cm

    1.75cm

    textbox1

    2.53968cm

    2pt

    2pt

    2pt

    2pt

    true

    0.63492cm

    TEXT

    10.75cm

    8427111c-07de-4d15-94cf-59f8095dd539

    2.5cm

    Function Testing(TestInt As Integer) As Integer

    MsgBox("MsgBox",4,"Title")

    Return 1

    End Function

    22.75cm

    29.7cm

    en-US

    2.5cm

    29.7cm

  • Sorry here comes an attachement of the RDL instead..

    /Jörgen

Viewing 15 posts - 1 through 15 (of 30 total)

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