bartbons Posted September 20, 2010 Share Posted September 20, 2010 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 More sharing options...
mdahlman Posted September 23, 2010 Share Posted September 23, 2010 This should be handled with groups. Consider this dataset: usa ca san franusa ca lausa wi milwaukeeca on torontoCreate 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 milwaukeeca on torontoRegards,Matt Link to comment Share on other sites More sharing options...
bartbons Posted October 1, 2010 Author Share Posted October 1, 2010 Ah yes, that works. Thank you very very much!! Link to comment Share on other sites More sharing options...
manasadontineni436 Posted January 23, 2018 Share Posted January 23, 2018 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 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