Jump to content
Changes to the Jaspersoft community edition download ×

Merging Rows of a table


charanraj

Recommended Posts

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
Link to comment
Share on other sites

  • Replies 10
  • Created
  • Last Reply

Top Posters In This Topic

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

Link to comment
Share on other sites

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
Link to comment
Share on other sites

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

 

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

  • 1 year later...
  • 1 year later...
  • 3 years later...

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×
×
  • Create New...