Click here to monitor SSC
SQLServerCentral is supported by Red Gate Software Ltd.
 
Log in  ::  Register  ::  Not logged in
 
 
 
        
Home       Members    Calendar    Who's On


Add to briefcase

Refer out of scope expression Expand / Collapse
Author
Message
Posted Wednesday, October 5, 2011 12:09 PM
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

Group: General Forum Members
Last Login: Tuesday, August 21, 2012 3:45 PM
Points: 7, Visits: 65
Here is my Expression that is trying to refer something out of scope:

=iif(Fields!fee_name.Value<>"monthly"
, StrConv(Replace(Fields!fee_name.Value,"_"," "), VbStrConv.ProperCase)
, iif(ReportItems("Text58").value > Fields!fee.Value
, StrConv(Replace(Fields!fee_name.Value,"_"," "), VbStrConv.ProperCase) &" (" & FormatCurrency(Fields!fee.Value) & ")"
, StrConv(Replace(Fields!fee_name.Value,"_"," "), VbStrConv.ProperCase)
)
)

It is giving me an error
Error 2 [rsReportItemReference] The Value expression for the text box ‘fee_name’ refers to the report item ‘Text58’. Report item expressions can only refer to other report items within the same grouping scope or a containing grouping scope. Letters in the names of report items must use the correct case.
Post #1186102
Posted Wednesday, October 5, 2011 2:26 PM


SSCertifiable

SSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiable

Group: General Forum Members
Last Login: Today @ 9:31 AM
Points: 5,162, Visits: 12,010
The error message seems self-explanatory: what is your question?


Help us to help you. For better, quicker and more-focused answers to your questions, consider following the advice in this link.

When you ask a question (and please do ask a question: "My T-SQL does not work" just doesn't cut it), please provide enough information for us to understand its context.
Post #1186182
Posted Wednesday, October 5, 2011 3:33 PM
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

Group: General Forum Members
Last Login: Tuesday, August 21, 2012 3:45 PM
Points: 7, Visits: 65
What do i need to do to get rid of this error?
Post #1186232
Posted Thursday, October 6, 2011 3:20 AM


SSCertifiable

SSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiable

Group: General Forum Members
Last Login: Today @ 9:31 AM
Points: 5,162, Visits: 12,010
I suggest that you read this to help your understanding of scope.

I can't give a specific answer, because that would require me to look into the design of your report.

But, based on the error message, it seems that the expression is being evaluated at a point in the report where the Text58 field is not defined or invalid.

As an aside, it is good practice to give your controls meaningful names: 'Text58' means nothing and is difficult to maintain.



Help us to help you. For better, quicker and more-focused answers to your questions, consider following the advice in this link.

When you ask a question (and please do ask a question: "My T-SQL does not work" just doesn't cut it), please provide enough information for us to understand its context.
Post #1186381
Posted Thursday, October 6, 2011 12:39 PM
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

Group: General Forum Members
Last Login: Tuesday, August 21, 2012 3:45 PM
Points: 7, Visits: 65
I am trying to fix this, can you please pass me your email address if possible I would like to set up a Web ex with you. It would be greatly appreciated.
Post #1186733
Posted Monday, January 28, 2013 1:43 AM
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

Group: General Forum Members
Last Login: Monday, January 28, 2013 1:41 AM
Points: 1, Visits: 3
Rename the TextBoxes to your own variable name and then you can reference them. Doesn't make much sense, but it works.
Post #1412235
« Prev Topic | Next Topic »

Add to briefcase

Permissions Expand / Collapse