## Converting query-based components to business view-based

In order for a query-based report component created in JReport Designer, such as table, crosstab, chart, and banded object, to be able to perform analytic reporting actions on when you work with them in Page Report Studio, JReport needs to convert the component from query-based to business view-based.

This section describes how JReport performs the conversion work and what a report designer should pay attention to in order to increase the opportunity of success in the conversion.

### When the conversion is required

The conversion is required when Page Report Studio end user is trying to perform an analytic reporting action such as drilling through data on a table, crosstab, chart, or banded object which is created based on a query.

There is a report tab level property available in the Report Inspector of JReport Designer: Automatic Cube Initialization. When the property is set to true, JReport will automatically convert the queries a report tab uses to business views when opening the report tab in Page Report Studio.

### What makes the conversion successful

The success of the conversion lies in the following aspects:

- There should be a business view referring to only the query that a report component uses.
- All the fields in the report component have corresponding elements in the business view. For the mapping relationship, see the section How to convert.
- The cases illustrated in What cannot be converted should be avoided.

Tip: The report designer can create a complete and full-function business view for the required query, in this way, all fields in the query are able to be converted since there are always corresponding view elements found in the complete business view. To create such a complete business view, create a group and a detail object for each DBField and formula, and create an aggregation for each summary.

### How to convert

The following lists what types of fields in the query will be converted to what types of elements in the business view:

When Query Fields Are Used As | View Elements
--- | ---
Group by field | crosstab group | chart X axis | chart Z axis | Group
Crosstab aggregation | Aggregation
Chart Y axis & summary based on fields and function | Aggregation
Chart Y axis & a Number data type element | Detail object
Others & there are corresponding detail objects in the business view | Detail object
Others & there are not corresponding detail objects in the business view | Group

### What cannot be converted

The following list shows the cases in a query-based component that do not support conversion. The list supposes that all the involved query fields have their corresponding view elements in the business view based on the query:

- Static summary (except that used as chart Y axis or current group by level).
- Dynamic summary (except when group by level = 0).
- Formula that references summaries.
- Page level formula, that is, the formula calculated after the whole report finishes rendering.
- Group by DBField or formula while the group has a special function.
- Group by parameter.
- Parameter on chart X axis | chart Y axis | chart Z axis.
- Chart in a banded object while the data of the chart is inherited.
- Table, crosstab, or banded object whose data is inherited.
- Table, crosstab, chart, or banded object when one of its children components cannot be converted (the children components exclude blank components and those having already been converted).