Jump to content
We've recently updated our Privacy Statement, available here ×

Cross Tab and Grouping - Any Help Appreciated


irnewbie

Recommended Posts

I posted this a while ag obut got no solutions or suggestions from anyone and wondering if I can try this time to get some help. I have no idea how to do this and am having continual problems trying to display a separate group by field from the query in a group above a cross tab sub report. The report design is a follows:

First of all I have a sub report with cross tab display that displays all results I require from the DB. But for each result the result could have been registered at a different location so I want to show a set of results per location and display that location field in the group header above the cross-tab. When I create a group in the sub-report it shows a location then one result, then the same location then another result but I want to keep all results from the same location in one cross-tab group. I have described the problem more visually below if that helps.

First of all I do not know how to perform what I am trying to do or whether I can do this in one report or have to use sub-report for the cross-tab. From what I have learned the summary band is where the cross tab goes and I need footer details for this report so this is the main reason I am using a sub-report as I cannot get the summary column above the footer. The sub report - I have tried in different bands in the main report like the page header etc but am not sure where to put it or if I need to group in the main report or sub-report.

This is my previous question:

I am using crosstab in iReport 3.7.4 and have found some help here with this design;

http://jasperforge.org/plugins/espforum/view.php?group_id=83&forumid=101&topicid=72213

The problem I am having now that I cannot find the solution is that I am grouping by say town and the crosstab shows results for each town but every record is split up into each town even if more than one results for the same town is there.

for example it will be like this:

town A

Results 1

town B

Results 1

town A

Results 2

but I am trying to get:

town A

Results 1
Results 2

town B

Results 1

I am not sure if it is the town column, which is what I am resetting the cross tab by. Do I need to change the resetting or change the town column to another band then update the resetting by part of it?

The town column is in the Group header, the cross tab is in the group footer.

Would anyone have any suggestions?

Thanks

Link to comment
Share on other sites

  • Replies 2
  • Created
  • Last Reply

Top Posters In This Topic

Top Posters In This Topic

From the looks of your example, it would appear to me that your datasource is not sorted correctly, verify the sort order to make sure that you are sorting by Town first and then Result, this should ensure that all your town records are coming through in the correct order.
Link to comment
Share on other sites

I tried that but it still lists both towns then the results below instead of grouping. The way I am doing it is I create the cross tab then create the group outwith the cross tab and then add the town field to the group - in every other normal report this works fine but with cross tab it is not working.

 

I would appreciate any more advice.

 

Thanks

 

IR

Link to comment
Share on other sites

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...