问题
I'm creating reports using Java and JasperReports. What I've got is a query that outputs hotel details in order of Hotel Name.
My problem is that, a lot of the time the Hotel Name field doesn't change from row to row. I want to find out how to only print each different hotel name once to stop the report printing unnecessary hotel names.
Anyone have any idea how to do this?
回答1:
Would a group not do what you want? You put the hotel name into a group and it will only be printed once.
回答2:
use the following option in your report element. reportElement isPrintRepeatedValues="false".
回答3:
You can uncheck the Print Repeated Value checkbox on the properties of the Text Field that displays the hotel name.
来源:https://stackoverflow.com/questions/3953733/jasperreports-hide-duplicate-field-in-report