izreena Posted February 27, 2012 Share Posted February 27, 2012 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 More sharing options...
honeybakliwal Posted February 27, 2012 Share Posted February 27, 2012 Yes you can implement it with the help of cross tab Link to comment Share on other sites More sharing options...
katepassaro Posted February 27, 2012 Share Posted February 27, 2012 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 More sharing options...
izreena Posted February 28, 2012 Author Share Posted February 28, 2012 I mean static columns and rows. Means I determine what will display in column, like a fixed Blue and Red. Regardless of the record returned, the Blue and Red column must appear. How do I do that? Thanks for the reply :D Link to comment Share on other sites More sharing options...
katepassaro Posted February 28, 2012 Share Posted February 28, 2012 Hm... So you want that column to show up no matter what, but it may sometimes show up? Could you provide a bit more of the details of the data? I know I've used fake columns to create such things. (null as "Blue" for instance. Link to comment Share on other sites More sharing options...
izreena Posted February 28, 2012 Author Share Posted February 28, 2012 Exactly, I want the column (Blue, Red, Total) and row (Bank Wire, etc) to always show up regardless of their measures. Like they are fixed. Thanks! Link to comment Share on other sites More sharing options...
katepassaro Posted February 28, 2012 Share Posted February 28, 2012 I would think that you would have to cast fake/null data into all the measured columns, and then cast the headings into the appropriate columns. Link to comment Share on other sites More sharing options...
izreena Posted March 5, 2012 Author Share Posted March 5, 2012 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 More sharing options...
lisacbeaton Posted June 1, 2012 Share Posted June 1, 2012 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 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