### Converting query-based components to report cube-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 be performed analytic reporting actions on when you work with them in JReport Web, JReport need convert the component from query-based to report cube-based.

This section details 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 JReport Web 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 level property available in the Report Inspector of JReport Designer: Automatic Cube Initialization, which controls whether a dialog will be displayed to the user to convert the dataset to a cube when the user requests an analytic action. By default, this property is set to false which means the cube will not be automatically initialized until the user does an analysis action such as dragging a new field onto the report. After that action, the cube is initialized and normal drilling and other actions will work properly. If you expect users to use the cube actions such as drilling, you should set this to true so that the conversion will be done automatically when opening the report set in JReport Web without the need for an explicit analysis action.

#### What makes the conversion successful

The success of the conversion lies in two aspects: there should be at lease one report cube in the query on which the report component is created, and the fields used in the component have corresponding cube elements which have been defined in the report cube.

To add chance of success to the conversion, the report designer should avoid the cases illustrated in What cannot be converted.

Tip: The report designer can create a complete and full-function report cube for the required query, in which way, all fields in the query are able to be converted since there are always the corresponding cube elements found in the complete report cube. To create such a complete report cube, create a dimension and a detail information for each DBField and formula, and create a measure 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 report cube:

When Query Fields Are Used As | Cube Elements
--- | ---
Group by field | crosstab dimension | chart X axis | chart Z axis | Dimension
Crosstab aggregation | Measure
Chart Y axis & summary based on fields and function | Measure
Chart Y axis & a Number data type element | Detail information
Others & there are corresponding detail information elements in the report cube | Detail information
Others & there are not corresponding detail information elements in the report cube | Dimension

#### 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 cube elements in the report cube 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 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).