Answered Drop Down List Parameter Error

  • Thursday, November 29, 2012 8:25 PM
     
     

    I'm using Report Builder 3.0 and I am trying to populate a drop list from a query in my report. 

    I have two datasets.

    The first dataset is a stored procedure that is passing three parameters, @StartDate, @EndDate, @FamilyCode

    The second dataset is pulling the family code off a table that the stored procedure uses.

    On my second dataset I can query the field just fine. I then proceeded to the parameter and assigned the secondary query to the Available and Default values but once I run the report I am given the following error:

    The Value expression for the text box ‘Textbox1’ refers directly to the field ‘familycode’ without specifying a dataset aggregate.  When the report contains multiple datasets, field references outside of a data region must be contained within aggregate functions which specify a dataset scope. 

    I am at lost and cannot figure out what to do next. 

All Replies

  • Friday, November 30, 2012 9:30 AM
    Moderator
     
     Answered

    Hello,

    Based on the error message, it seems that you add a textbox in the report and specify the value expression for the textbox without add the scope in the expression, for example, =First(Fields!Familycode.Value).

    When there are more than one dataset in the report, we should specify the dataset that associated with the Tablix data region, for example,
    =First(Fields!Familycode.Value,”Dasetname”).

    If I have any misunderstanding, please share a screen shot about the design structure of the report and the value expression for the textbox, it benefit us for further analysis.

    Regards,
    Fanny Liu


    Fanny Liu
    TechNet Community Support

    • Marked As Answer by HOG MobN Friday, November 30, 2012 3:59 PM
    •  
  • Friday, November 30, 2012 3:59 PM
     
     

    That makes sense! I was able to get it work, and of course it was case sensitive :-)

    =First(Fields!familyCode.Value, "FamilyCode") & " " & MonthName(Month(Parameters!EndDate.Value)) & "-" & Year(Parameters!EndDate.Value)

    Thank you so much for you help!!!