Purchase your Section 508 Compliance Support guide now!

Purchase your Section 508 Compliance Support guide now!

Cognos 8 -- Report Studio error with conditional variable

If there is a conditional variable that is based on a query item which is not displayed within the current container on the report layout then Cognos may generate an error message, such as "CRX-API-0005 An error on or around the position '0'".

This can be related to Cognos 8 optimizing a report's queries to eliminate unused data items from the resulting query's SQL or MDX. In order to include a query item on the layout without displaying the object you should try adding the query item to the properties of the container in the layout. This can be done by using the "Properties" property.

Steps:
Select the report object that has the conditional variable being used for formatting or any other object that the report author may be using with the conditional variable.

1. Use the control above the properties pane to navigate the ancestor objects from the layout. For a list report, select the List object. For a crosstab report, select the Crosstab Node Member.
2. Locate the Data section in the Properties pane for the List or Crosstab Node Member object.
3. Within the Data section, click on the elipses "..." next to the Properties entry.
4. Select the query item that is being used in the conditional variable expression.
5. Click OK to return to your report layout. The data item should now be available within the scope of your List or Crosstab Node when the report is executed.

If the error still appears when a data item is being used directly on the page without a query container such as a list or crosstab then similar steps can be taken to set the available query items at the Page level. To do so:

1. Select the Page object from the ancestor control after selecting any object in the page layout.
2. Set the Query property of the Page object to reference the query containing the required data item.
3. The list of available query items can now be set for the Page using the Properties entry in the Data section of the Page object properties.