Jump to content

crosstab - few issues, eg. merging cells, blocking


markos17

Recommended Posts

I use crosstables in iReport. I have some problems.

1) Now, crosstabs merge my cells, I've attached screenshot with an example. Look at column B, I'd like to have spare names in every cell, like in colum N.

2) How to use default value for cells with no value? Now, when there is no data, crosstable shows "0" (eg. L49,L50,L51,L52). In database I set "0" for "d" and then crosstable shows "0.0000" (L53) Is it possible, to set some value, like "-" in case there is no data?

3) Last thing, which bothers me, is blocking cells/rows in Excel. I'd like to block the top row, so it's always visible, when I scroll XLS document down. Is this possible at all?

Thanks in advance, for any help!

Link to comment
Share on other sites

  • 3 weeks later...
  • Replies 4
  • Created
  • Last Reply

Top Posters In This Topic

Without looking at your jrxml crosstab properties, it would be pretty hard to guess the problem. But, looking at your output screenshot .... it looks like you might be doing grouping on rows. Try removing the grouping option, that could give you the output you are looking for. Hope that helps.
Link to comment
Share on other sites

  • 2 weeks later...

Yes, I'm using Row Group. It's essential in my case. I found some option->JasperReport Properties->PROPERTY_COLLAPSE_ROW_SPAN, it's set on false by deafault, but still cells are merged :/



Post Edited by markos17 at 04/22/2010 14:09
Link to comment
Share on other sites

  • 6 years later...

Hi,

I have faced few of your scenario in crosstab and used the below solutions

1. Crosstabs merge my cells - First this is not an issue but in some user requirement they want to avoid merge cells.

    Solution :

        1. Combine some distinct row group values along with merging row group in the row expression. This step will give distinct row group value

        2. Edit the row group textbox by adding split function and display the value

     For eg:  Consider row group columns as ID, Name, State, Country and this will merge the value of state and country has same value.

        1. As explained in the solution part, combine the $F{ID} row group column along with $F{State} and some split/delimited value

                $F{ID}+"&"+$F{State}

        2. Make use of split funtion in the row group text box

                $V{rowgroupname}.split("&")[1]

2. How to use default value for cells with no value

        Solution:  In your rowgroup display textbox write the own expression to find no value/null and set default value like

        $V{rowgroupname}==null?"-" :$V{rowgroupname}

       The above expression will check no/null value of your field given in row group expression. if it is null/no value it will print "-" or your field value.

Regards,

Dinesh S

 

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