Passing variables between reports?!

  • Hello,

    I'm creating new reports. I come from a Crystal Reports background.

    I want to use one detail report. I want to make this detail report available to 2 or 3 summary reports.

    Based on a variable, I can show specific data.

    In Crystal Reports, I would make a variable global. I would then would link the reports on the variable.

    In SSRS, I only see where to link the reports based on parameters of a stored procedure. I have a begin date and end date in the stored procedure in my stored procedures for my detail and summary reports. I can pass dates between the two reports. Great.

    How do you just pass a variable from one report to another without creating a parameter in the stored procedure?

    For example:

    I want to pass a variable m90 (string variable). It would either have a value of "Y" or "N".

    If it is "Y", then I will have the detail report title be "90 Day Detail report".

    If the variable is "N" then I will have the detail report title be "Detail report"

    Thanks.

    Tony

    Things will work out.  Get back up, change some parameters and recode.

  • On your summary report, where you have (or want) the link to the detail report to be, right click that object and select Properties, then select the Navigation tab.

    You'll see on that tab the 'Jump to Report' radio button (which I assume is checked), and you can select which report to jump to (from reports in the same solution).

    If you click the parameters button, you can define the parameters that you send to the detail report.

    You can certainly map the parameters on a 1-1 basis (e.g. pass each parameter in the summary report to the detail report), but you can also map additional values to parameters in the detail report. So, for example, you can set up m90 as a parameter in your detail report, then have one summary report link send a Y for that parameter and another summary report link send an N.

    Within the detail report, you can then add filters or conditions based on that m90 parameter. You can make the parameter itself hidden, so the end-user never sees it (under the menu option Reports > Parameters). There's no correlation between parameters in the SSRS report and stored procedure parameters - you can have parameters in the SSRS report that aren't sent to the stored procedure as a parameter. They are separate concepts.

    Does that answer your question? Let me know if I've mis-understood what you're trying to accomplish.

    Leonard
    Madison, WI

  • Hey man,

    Thanks for responding.

    What link?

    I guess I am not understanding that part. I've created the parameter m90. Now what link are you referring to?

    Do I need to put a textbook on the report for the parameter m90?

    Thanks,

    Tony

    Things will work out.  Get back up, change some parameters and recode.

  • What link?

    I guess I am not understanding that part. I've created the parameter m90. Now what link are you referring to?

    Do I need to put a textbook on the report for the parameter m90?

    The link referred to is the textbox action that when clicked will jump you to the other report. To build it you go th the textbox properties dialog and go to the action tab.

    No you don't have to put a textbox on the destination report for m90, but you will have to put the parameter in the report. In other words the parameter does not have to be exposed in a textbox on the report, but it does have to be defined in the report.

  • I'm using SSRS 2005 to build the reports. In my solution, there are two reports (R1 and R2). In the report R1, there is a variable x which is changable in the dropdown list by users. Now I need to pass the value of x to the report R2. In the hyperlink action on the textbox of the report R1, the "Jump to report" is set to R2. On the Parameters Window, I set Parameter Name = x and Parameter Value =Parameters!x.Value. But I do not know how the report R2 gets the value of x. Any suggestions?

    Thanks in advance.

    --------------------------------------------------------------
    DBA or SQL Programmer? Who Knows. :unsure:

  • R2 must have a parameter that you feed with the variable value from R1.

    Set up your parameter in R2. Build R2 so that it will run when given the desired parameters and then deploy it.

    In R1 create your action to the R2 report and in the parameters section choose the input parameter for R2 and give it the value of your variable.

  • Thank you, Daniel for your response. I actually did the same way you described in your post and it worked. Thanks.

    --------------------------------------------------------------
    DBA or SQL Programmer? Who Knows. :unsure:

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

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