Optional blocks depending on a component is installed or not¶
Some reports includes data from other components. This is traditionally done by introducing dynamic SQL and/or PL/SQL. But, a better solution is to let the compiler figure out what parts to include in the code or not. In the model you simply say that a particular block required that a specified component is installed.
The following example shows a movie toplist report that has a block that depends on an optional component:
block Scene requires FILMDB { attributes { attribute SceneIndex Integer; attribute Duration Number; attribute Content Text(2000); } entities { } }
The model supports that concept for the generated RDF file by adding compiler directives at the right places. When a new component is installed, that part of the code is automatically activated and the report includes the new data.