Query Compatibility

Binding Queries

You can dynamically change the data binding of an element from within script by setting the “query” property.

if(parameter['type'] == 'Details') {
   Table1.query = 'sales details';
}
else {
   Table1.query = 'sales summary';
}
demo
Read how InetSoft saves money and resources with deployment flexibility.

Query Compatibility

You should only change the “query” property from within the onInit Handler or onLoad Handler - query name, such as grouping and summary fields, and formula columns. If you change a query from within script, you must make sure that the new query is compatible with these other specifications.

For Table and Chart elements, a query is considered compatible if it contains the same grouping and summary columns specified in data binding. Since the table can adjust itself to accommodate any tabular data, no change in table layout is necessary.

Because Section elements have fixed layout, the compatibility rules are stricter. If you use script to change the query binding for a Section, the new query must contain exactly the same columns as the query that it replaces. Otherwise, the Section will not display the new columns and will use default values for all columns that are missing in the new query.

In practice, dynamic query binding is most useful when your reports have tables with the exact same columns, but with different conditions or data sources. Keep in mind however, that Report Beans are the preferred way to achieve component-based reporting and report reuse.

performance dashboard
Read the top 10 reasons for selecting InetSoft as your BI partner.