charanraj Posted September 19, 2011 Share Posted September 19, 2011 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 More sharing options...
sanbez Posted September 20, 2011 Share Posted September 20, 2011 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) Link to comment Share on other sites More sharing options...
charanraj Posted September 20, 2011 Author Share Posted September 20, 2011 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 Link to comment Share on other sites More sharing options...
sanbez Posted September 21, 2011 Share Posted September 21, 2011 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 More sharing options...
sanbez Posted September 21, 2011 Share Posted September 21, 2011 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". Link to comment Share on other sites More sharing options...
charanraj Posted September 21, 2011 Author Share Posted September 21, 2011 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 More sharing options...
sanbez Posted September 21, 2011 Share Posted September 21, 2011 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 More sharing options...
charanraj Posted September 22, 2011 Author Share Posted September 22, 2011 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 More sharing options...
Sudhakarkmt Posted June 14, 2013 Share Posted June 14, 2013 HI,i wanted to do in tables.....if repeated values are there then they should be merged.Can anyone help me Link to comment Share on other sites More sharing options...
Grammer Posted August 14, 2014 Share Posted August 14, 2014 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. Link to comment Share on other sites More sharing options...
anji.viper Posted November 22, 2017 Share Posted November 22, 2017 I searched a lot too and finally managed to do it.. Here's the related post for whoever needs it:Merge rows when repeated values table Cheers :) Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now