locked
single quotes value being passed to a subreports query RRS feed

  • Question

  • User-1210839387 posted

    using report builder 2.0

    I have a subreport where I am passing a text value as a parameter.

    The problem is that when I test hardcode the value in the subreport

    Ex:

    <SQL>

    SELECT * FROM myTable WHERE myDog='Fido'

    </SQL>

    this returns values ok but when I run it like this:

    <SQL>

    SELECT * FROM myTable WHERE myDog=@paramDogName

    </SQL>

    when I run this I am getting no values returned despite passing in the dogname value to subreport.

    do I need to include single quotes in the value I pass to the subreport?

    thanks
    MC

    Wednesday, July 6, 2011 9:43 AM

Answers

  • User2105670541 posted

    Why dont you pass the data from the parameter, i mean let the user select dog name from the parameter and pass this parameter to your subreport because there must be a static value for the subreport, you cannot have multiple fieldset and pass them as a sub report parameter.

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Wednesday, July 6, 2011 12:08 PM

All replies

  • User-1210839387 posted

    update:  the problem is that I am returning values from the main report and passing the dogName value to the subreport but I just checked the main report and there is no value being passed even though I am selecting the value from the dropdownlist on the params properties. I am selecting the value:

    =First(Fields!DogName.Value, "Config_Data")

    but when I run the report I get the dreaded "error: subreport could not be shown" error, not very descriptive.

    I realize part of my problem is that I am returning one record for the main report so I need to get a static value to pass to the sub report.  I wil use this one static value (not a value from each record) to pass to the subreport.

    Wednesday, July 6, 2011 9:50 AM
  • User2105670541 posted

    Why dont you pass the data from the parameter, i mean let the user select dog name from the parameter and pass this parameter to your subreport because there must be a static value for the subreport, you cannot have multiple fieldset and pass them as a sub report parameter.

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Wednesday, July 6, 2011 12:08 PM