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

suppress repeated columns


bartbons

Recommended Posts

 Hi,

I have a question: Let's say we have 4 columns on a detail band: A,B,C and D. Column A can have the same value, and repeated values should be hidden. So I uncheck the "Print Repeated Values" property. That works.

But now I also want to hide the columns B and C when column A is empty.

Adding a "Print When Expression" on B and C like:

!($V{A}.IsEmpty())

does not work because even though the textfield of $V{A} is suppressed, the variable $V{A} still contains a value. So I cannot use that.

I would need something like: !($Textfield{A}.IsEmpty())

I also tried grouping the columns A, B and C into one element, but iReport does not have a "Print When Expression" on the group-element.

Is changing the SQL query the only option here?

Link to comment
Share on other sites

  • Replies 3
  • Created
  • Last Reply

Top Posters In This Topic

This should be handled with groups. Consider this dataset:

 

usa ca san fran
usa ca la
usa wi milwaukee
ca on toronto

Create a group called country and a group called state. Do not display a group header or footer for either.

Now you still display every row in the detail band. But you only want to show each country and state the first time it appears in its respective group. That's easy. You set the Print When Expressions to $V{country_COUNT} == 1 and $V{state_COUNT} == 1. This will generate output like this:

usa ca san fran
       la
    wi milwaukee
ca on toronto

Regards,
Matt
 

 

 

Link to comment
Share on other sites

  • 7 years later...

Hello Matt,

 

I have similar report  requirement. But the design is a little different. I need to dispaly country & State only once when repetation but it should display in center and all columns has boarders to it. The design really looks ugly when i write formula or disable/unselect 'print repeated values' It looks better when i make field data to repeat.

 

Any suggestions are more appreciated!

 

Thanks

 

Manasa

 

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