iReport is an reporting tool used for designing jasper report in OpenERP. In OpenERP it is difficult to create a report that has a dynamic column. For instance consider an example of a project report that has details regarding the project task completion date. The task name will be the name of the column. In such cases, the cross tab in report comes handy.
Crosstab can be found in Palette in iReport. It can be dragged and dropped in to the report as needed. Initially create a report. Drag the crosstab from pelette and drop it in the report. A wizard for the crosstab creation pops out. First we have ro select the datasource for the crosstab. I am using my main report data source for my crosstab.
Select your datasource and click next.
Next we have to select the row group. Row group defines the rows for grouping. In this case since the report deals with task for each project. Hence i am defining the row group as project which is the name of the project.
Next we have to select the column group. Column group corresponds to the name of the column. In this case the task name is the name of the dynamically varying column. So i am defining the column group as task which is the task name.
Next we have to select what detail of the task that correspond to each project has to be displayed. In my report i am giving the start date of the project.
Next we have to select the layout of the crosstab. We can add row group, column group or guidelines based on the requirement. Now the crosstab appears in the main report. If we want to add some row group or column group, go to report inspector in iReport, Expand the crosstab right click on row group or column group and click Add row group or Add column group as we need.
Cross tab is a useful tool in iReport and can be modified as our requirement. The project report will be generated as: