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

Crosstab with static column/row


izreena

Recommended Posts

 Hi all,

Is it possible for Crosstab to have static column/row. For example below, can I have a fixed Blue, Red column and fixed Bank Wire, Credit Card, Cheque row instead of it generating dynamically?

 

Or should I not use Crosstab but other iReport elements instead?

 

Thanks!

Code:
     Transaction      Blue      Red       Total    ---------------+---------+---------+---------     Bank Wire     |     0   |    0    |     0     Credit Card   |     2   |    0    |     2     Cheque        |     1   |    0    |     1    ------------------------------------------------    Total All           |     3   |    0    |     3     --------------------------xx-----------------------
Link to comment
Share on other sites

  • Replies 8
  • Created
  • Last Reply

Top Posters In This Topic

 Yes - this is definitely possible with Crosstab - The order of your columns is alphabetical so they could generate dynamically without a problem. 

If you want to have them show up in a certain order that isn't alphabetical - you can add a helper column to the query, and use that as the first column/row grouping, and then put the titles as the second grouping - but then show the width/height of the first grouping as 0. 

Link to comment
Share on other sites

I'm not sure I understand. I just want static columns and rows where the only dynamic element is the measures that will count according to the criteria (column & row) that I have fixed


 

  Column 1 (fixed) Column 2 (fixed)
Row 1 (fixed) R1 x C1 (dynamic) R1 x C2 (dynamic)
Row 2 (fixed R2 x C1 (dynamic) R2 x C2 (dynamic)



----------------------------------------------------------------

Solved this by putting in Static Texts for all my fixed values, and creating single variables and manually inserting expression formulae for each of the variables to imitate the crosstab. I did not even use the crosstab element at all as it is for dynamic rows and columns only.



Post Edited by themillie at 03/06/2012 09:19
Link to comment
Share on other sites

  • 2 months later...

themillie, I'm trying to do this, too (I posted about it on StackOverflow http://stackoverflow.com/questions/10834529/ireports-organizing-column-output but haven't gotten any responses). Can you give some additional information on how you were able to achieve this? Did you put your static row and column headers into the detail band? How did you define the variables?

Thanks,

Lisa

 

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