India

ZestyBeanz Technologies Pvt Ltd 4th Floor, Nila, Technopark Thiruvananthapuram,
India – 695581
Phone: +91 471 4063254
Fax : +91 471 2700171

   .

ZestyBeanz Technologies Pvt Ltd
61/3236, Manikkath Cross Road
Ravipuram, Kochi, India - 682016
Phone: +91 484 4063254

  UAE

Zesty Labs
Office # 2003, Millennium Plaza Building
Sheikh Zayed Rd, Dubai, UAE
Phone: +971 4333 2222​
Mobile: +971-52-7553466

  Germany​

ZestyBeanz Technologies GmbH
Reuterstraße 1
90408 Nürnberg
Fon: +49 911 4801 444
Fax: +49 911 4801 445

Crosstab in iReport

Contact Form


Prajul P T's picture

Crosstab in iReport

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:

Aman's picture

Hi Prajul, I have created a

Hi Prajul,

I have created a multiple sheet report in single excel sheet by using the same method you mentioned. My requirement is that I have to give names to these sheets. As per my project requirement, I have to use ireport 3.0.0.
I tried using the property tag in my jrxml to define sheet names as
but it is not working. Can you please suggest a way to handle it.

Thanks in advance,
Aman

Prajul P T's picture

Hi,      Please

Hi,

     Please use 'net.sf.jasperreports.export.xls.sheet.names.all' property. The report name shoud be passed in the form '/Sheet1/Sheet2/Sheet3'.

Sameer's picture

Hi Prajul, Thanks for the

Hi Prajul,

Thanks for the prompt reply.

But, the problem here is; we have to create a sinngle XLS file which will have details of lets say under first tab master account details, on second tab child account 1 details, on third tab child account 2 details and so on..

i am not able to figure out how this can be achieved and where do i need to write the java piece of code?

can u hep me by taking an example or any step by step process.

Thanks

Sameer

Prajul P T's picture

Hi,     Based on your given

Hi,

    Based on your given example, i think you could use subreport with JDBC datasource. Create two subreport let say A and B where A is for main accounts where account type is 'View' and B for normal reports. Create a new main report and in the main report, fetch all the accounts that has the type 'View'. Create a group to group this accounts. In the group properties, set start on a new page property. The details band of the main report should contain the subreport A which is for the account of type "View". Pass the accont number from the main report to the subreport as a parameter.

     In sub report A fetch details of the accounts that comes under the main account that is passed from main reports. The pattern of the sql query should be:

<Query to fetch account details> where parent_id in $P{account from the main report}

       create a group in subreport A which groups the child accounts fetched. The details band of the subreport A should contain the subreport B. Set the property of the group to start on a new page. Pass the account number of the child account fetched in to the subreport B as parameter.

        In subreport B, display the details of the child account  passed from the sub report A. 

        I think this could help you......

Anonymous's picture

i am facing one problem in

i am facing one problem in cross tab.. when cross tab column group is field value is null then i want to restrict to create new column ..