views:

933

answers:

3

Hi

I want to show multiple detail section in my jasper report.How to add multiple detail bands in jasper.For details band I am passing collection from my java class.So if I have multiple detail band how to pass the different collections to different detail band.

Can some one provide help on this

+2  A: 

Multiple "Detail" bands is not possible. You can add "Group Bands" before and after the Detail band though.

UPDATE
For the upper part of the report:

  • The Detail Band is the one with the Product Line, Name, Amount ... etc.
  • The Group surrounding the Detail, containing the Branch is one level upper group.
  • The Group surrounding the Branch Group is the State Bang, its the top level.

First make two groups, call one of them "State" and the other "Branch", When writing your query make sure you order the results by State, then Branch. If you do that, Jasper will make sure to group the results exactly as in the snapshot.

Check this snapshot, you should make the report something like this:

alt text

medopal
I want to show something looks like this http://dynamicjasper.sourceforge.net/images/snapshots/subreport-report.png?rand=317477712 .. Different detail band with different columns.I think I can call it as subreport.
BlackPanther
There is a thing called exactly "subreport" in jasperreport
@contexte, in this case you can solve it with groups no need for subreports.
medopal
@medopal, I see. I agree, that inside each "table" there must be groups, but on the picture we see two such "tables". To have "Different detail band _with different columns_", BlackPanther needs subreports for sure. Of course you can simulate this behaviour with groups but it's not the straight way.
@contexte, thats very sure, in my answer i explained how to remake the upper part of the report. But sure if you want both in one report then you should use a subreport.
medopal
Here we should ask BlackPanther to be more precise what (S)he needs. It seemed to me that the main question was exactly about "two tables in one report". That why I was so annoying with subreports.) But of course I could mistake.
+1  A: 

You should use subreports.

+1  A: 

it's seems that this question was asked long time in past. Now with new JasperReports version, multiple detail bands are possible. Please refer to JasperReports download for latest revision.

Kuldip Shah