Purchase your Section 508 Compliance Support guide now!

Purchase your Section 508 Compliance Support guide now!

CRX-API-0005

Problem(Abstract)
We have a master detail report comparing data submissions for a particular table. Where there is a difference between any particular column (eg a customer name change) we're trying to use a condition (query1.description <> query2.description) to highlight it. We get an error when we run the report.

Symptom
CRX-API-0005 An error on or around the position '0'. The variable named '' is invalid.

Cause
A report expressions (in this case, the conditional expression) can only look up data items that are in its direct context. That means that the place where it is evaluating the condition has to be within a
container that is associated to a query, and we can only look up values from the "nearest" container. So imagine that you're the expression, and you're sitting in a box. That box may be inside of another box, but you don't really know because all you can see is the box you're in.

Resolving the problem
Make the data we want to evaluate part of the second query. Take a simple example from our Go Sales and Retailers of a nested list, in which the outer list shows Product Line and quantity, and the inner
list shows order methods and quantity. If we want to put a condition on the Order Method based on a comparison between the order method quantity and the product line quantity, we'd need to add a second data item to the order method query that calculates the total for each product line. Now both values are in one query, and we can evaluate them in one expression.