SSRS sub reports passing values

RCDA Webmaster 291 Reputation points
2025-01-27T18:24:32.15+00:00

I have a main report with a bunch of sub reports. I'm trying to pass a parish ID to the sub report from the query field [par_num].

Sub Report:

The query's Parameter:

Parameter Name
@ParishID

Parameter Value

@ParishID

Query Snippet: WHERE tblInfoTechnology.Parish_ID = @ParishID

The Sub Report property(parameters):

Name

ParishID

Value

[Par_num]

I'm getting an error in the main report: one or more parameters were not specified for the subreport. What did I do wrong?

SQL Server Reporting Services
SQL Server Reporting Services
A SQL Server technology that supports the creation, management, and delivery of both traditional, paper-oriented reports and interactive, web-based reports.
2,988 questions
0 comments No comments
{count} votes

2 answers

Sort by: Most helpful
  1. RCDA Webmaster 291 Reputation points
    2025-01-28T16:40:32.9566667+00:00

    I finally got it to work. I don't know why I didn't see it before, but there is a folder for parameters under report data window. in there were 2 parameters @ParishID and @Parish_ID. when I removed the second with the underscore, the report was happy to display as it was no longer looking for a parameter to be passed that was missing a value.

    1 person found this answer helpful.
    0 comments No comments

  2. Michael Taylor 56,861 Reputation points
    2025-01-27T18:58:22.02+00:00

    The error indicates an issue with how the main report is passing data to the subreport.

    Is this report set up such that you pass some ID as a parameter to the main report and then it renders the data from that ID and uses subreports to display child reports based upon that same ID? If so then in the subreport properties you should be using the main report's parameter.

    Name: ParishID
    Value: [@ParishID]
    

    Here ParishID is the parameter defined in the subreport and @ParishID is the parameter in the main report. If instead you are enumerating rows of data and each row has a subreport then the value would be the field used in the main report's dataset instead. These values should be automatically shown when you use the dropdown list for the value.

    In the subreport's Parameters section the parameter should be named without the @. From the earlier sample that would be it would be called ParishID. Then inside your query you use @ParishID.

    Based upon the error I believe your main report is not properly providing the parameter's value. Note that if the report requires several parameters then ensure you're assigning values to all of them.


Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.