sql - Merge same cells in iReport -


is possible have sum in detail band in ireport? important have cells merged vertically after export excel this:

----------------------------- | id  | year | value | sum  | ----------------------------- |     | 2010 |  55   |      | |  1  | 2011 |  65   |  180 | |     | 2012 |  60   |      | ----------------------------- |  2  | 2010 |  70   |  70  | ----------------------------- 

my idea have main query group clause , "year" , "value" use table component query. problem query long running , need have 1 in whole report.

first have @ here. it's grouping rows.
see should create group in report, not in query depending on id field.

  1. for calculating sum field, drag value field column footer, , see pop-up menu. click result of aggregation function radio button, choose sum function. create variable calculate sum of value field. change variable's reset type group (to id_group). use field in sum field.
  2. for grouping rows depending on id, click on sum field , set field's print when group changes id_group.

this should :)

when group fields table this. grouped fields @ top.

----------------------------- | id  | year | value | sum  | ----------------------------- |  1  | 2010 |  55   |  180 | |     | 2011 |  65   |      | |     | 2012 |  60   |      | ----------------------------- |  2  | 2010 |  70   |  70  | ----------------------------- 

Comments

Popular posts from this blog

linux - xterm copying to CLIPBOARD using copy-selection causes automatic updating of CLIPBOARD upon mouse selection -

c++ - qgraphicsview horizontal scrolling always has a vertical delta -