BOOLEAN

A Boolean field is mapped to Yes/No values.

To configure a Boolean field either in filter or retrieval criteria, set the field type as BOOLEAN and configure the simple mapping to map the field with the SQL parameter.

Following is an example of display a Boolean field in the table of the report.

Include the Boolean field in the select clause. In the following example, AvailableOnline which is a Boolean field from the book model is illustrated.

select available_online Available_online FROM ZBKS_Book

The retrieval should be defined as follows:

<CustomRetrievalField>
<FieldRef levelType="ZBKS.Book" category="PDF">
<FieldName>AvailableOnline</FieldName>
</FieldRef>
<Type>BOOLEAN</Type>
<SimpleMapping sqlName="Available_online"/>
</CustomRetrievalField>


To filter a Boolean field, include the condition in the where clause of the SQL:

where ${filterIfNotNull:AVAILABLE_ONLINE,available_online = $AVAILABLE_ONLINE$}

Include the following filter crriteria

<CustomFilterField>
<FieldRef category="PDF" levelType="ZBKS.Book">
<FieldName>AvailableOnline</FieldName>
</FieldRef>
<Type>BOOLEAN</Type>
<Optional>true</Optional>
<SimpleMapping sqlName="AVAILABLE_ONLINE"/>
</CustomFilterField>

Following are the key points to note:


  • LevelType in the FieldRef is pointed to Book, which is where the AvailableOnline field is defined.

  • Field Category is set to PDF(PreDefined Field)

  • Field name is the same as the one defined in the Book model.

  • Type is set as BOOLEAN (Note the capital letters)

  • SimpleMapping is defined in the CustomRetrievalField

  • SimpleMapping contains sqlName as an attribute whose value references to the SQL parameter defined in the select clause of the SQLDef