Queries are the data sources used for creating page reports in Logi JReport Designer.
Queries are a higher-level object in a catalog. The concept is similar to that of views in the database but they are stored in the catalog file rather than the database itself. In this way, a query is independent from the raw database since Logi JReport uses a mapping name that is unique instead of the table.column syntax of SQL. You can use queries to view, change and analyze data in different ways, and Logi JReport can help you with the building of various professional reports based on queries. When making a query, you can place criteria or restrictions on the data to extract only the required data from the database. For example, instead of having to view all the customers of your company, you can view just the customers from Japan.
Logi JReport Designer includes an interactive Query Editor to build queries. The following shows an example of creating a query with the editor using the data that have been retrieved from the SQL Server database in the previous topic.
- Select New Query in the New Queries or Business Views dialog that is prompted after you finish adding tables from the database into the Logi JReport catalog (if the dialog does not show up, select Resume on the Catalog Manager toolbar).
- In the Enter Query Name dialog, input the name of the query and select OK.
- In the Add Tables/Views/Queries dialog, expand the connection > Tables node, the database tables that have been added into the catalog are listed. Add the tables you want to use in the query.
Logi JReport Designer allows you to combine tables, views, synonyms, imported SQLs, stored procedures, user defined data sources and other existing queries into a query to mash up multiple data resources in a single query, and create distributed joins to set up inter-relationships between the data resources.
- In the Query Editor, check the columns in each table to be used in the query and join the tables to make them interrelated.
The Query Editor provides many features for customizing a query. For example, you can filter the data to be retrieved from the database for the query so that when you build reports on the query, the returned results will be narrowed down. For more information about the usage of queries in Logi JReport, select here.
- Select OK to create the query.