Merging Rows of a table

0

Hi,

I'm a newbie to jasper reports. Just started looking into it two days back. :)

I'm trying to merge cells of a table. For example: cells with same same values will be merged. Currently I'm getting the border lines for each cell. I want these cell to be merged similar to the attachment that I have attached. Would appreciate if someone would guide me in the right path.

Thanks in advance.



Post Edited by charanraj at 09/19/2011 13:59
charanraj's picture
Joined: Sep 19 2011 - 6:49am
Last seen: 2 years 11 months ago

9 Answers:

0
There is no way of the decision of this problem :(
Try uncheck option "Print repeated values" on first field, but this field will be displayed only on the first row (not in middle)
sanbez's picture
408
Joined: Jan 11 2011 - 2:06am
Last seen: 5 days 14 min ago
0

Thanks sanbez

Sad :( Currently I'm using with "Print repeated values" unchecked. But in excel the cell borders are visible. Is there any work around for this?

Thanks in advance

charanraj's picture
Joined: Sep 19 2011 - 6:49am
Last seen: 2 years 11 months ago
0
I make subreport with all fields (excluding first field). First field and subreport placed into frame with displayed borders. First field haven't borders.
In result of execution report, first field displayed with borders of the frame (borders not in every row for first field).

Sorry for bad english
sanbez's picture
408
Joined: Jan 11 2011 - 2:06am
Last seen: 5 days 14 min ago
0
Sorry, i am forget that in the case of using subreport you may solve your problem by setting "Stretch type" for first field with "Relative to Band Height".
sanbez's picture
408
Joined: Jan 11 2011 - 2:06am
Last seen: 5 days 14 min ago
0

Thank you very much sanbez :)

Now I'm facing another issue, say i have 3 unique records in the first field and 10 records in the subreport. I have placed the first field and subreport inside a frame and placed this frame inside the detail of main report. The output I'm getting is complete frame is repeated 10 times. I have unchecked the "Print Repeated Values". Still the complete frame is repeated 10 times :( any solution?

Thanks in advance.



Post Edited by charanraj at 09/21/2011 13:35
charanraj's picture
Joined: Sep 19 2011 - 6:49am
Last seen: 2 years 11 months ago
0
It is strange behavour. But probably I was too short in the explanations.

I writing in iReport by using java-collections. In this case i do next steps:
1. Define java-class for the storage of result my calculations. For example:
class FirstColumnInfo
private String FirstColumnValue;
private List<FirstColumnChildren>
...
class FirstColumnChildren
private String SecondColumn;
private String ThirdColumn;
and so on

2. Writing java-code for search data. In this code i fill my structure:
Collections<FirstColumnInfo> resultComputing = findCollection();

3. Creating DataSource and filling JasperReport:
JRBeanCollectionDataSource dataSource = new JRBeanCollectionDataSource(resultComputing);

4. Filling Report:
JasperFillManager.fillReport("report.jasper", reportParametrs, dataSource)

... and so on (some actions for subreport)

If you are use SQL-query as data source for report, i think that you must to do two query (1. for main report and 2. for subreport):
1. select distinct(first column) from (yuor query)
2. For subreport you must define parameter: firstColumn
and query for subreport (select * from (your query) where first_column=Parameter)

It is very bad by productivity, but i think you may find optimal queries for both reports (main and subreport).

Good luck
sanbez's picture
408
Joined: Jan 11 2011 - 2:06am
Last seen: 5 days 14 min ago
0

Thanks sanbez for the steps. You always rock. It was really helpful :)

I'm trying to export report in xls format and there are lot of empty cells which drags the page longer. Is there a way to stop it? I tried "Relative to Band Height" & "Relative to Tallest Object" but it dint solve the issue.

 

Thanks in advance.

charanraj's picture
Joined: Sep 19 2011 - 6:49am
Last seen: 2 years 11 months ago
0

HI,i wanted to do in tables.....if repeated values are there then they should be merged.Can anyone help me

 

Sudhakarkmt's picture
Joined: Jun 12 2013 - 10:49am
Last seen: 8 months 2 days ago
0

Up.

Have the same problem - merge cells by rows for same values. Maybe it is a good idea to have some grouping/merging function for column in table component.

 

prog85's picture
2
Joined: Aug 14 2014 - 3:08pm
Last seen: 1 day 10 hours ago
Feedback
randomness