How can shifted column-name in place of previous column name when column not contains any value

I'm printing a report using ireport tools

Consider there is a table Student which having 4 columns Student-Id, Student-First Name, Student-Last Name, and Student-Age.

In My Student Table Student-Last Name column not contain any values. i want to generate a report in such a way that if any column name not contains any values then that column name shifted to another column name, in place of previous column name.


Student-Id                                         Student-First Name                               Student-Last Name                  StudentAge
    
    201                                                            Vinay                                                                                                              24
    
    202                                                          Kishore                                                                                                             26
    
    203                                                             Komal                                                                                                               28

So went I display my report, I want My Student-Age column name come in placed of Student-Last Name .

Output:

tudent-Id                                         Student-First Name                                                StudentAge
    
    201                                                            Vinay                                                                         24
    
    202                                                          Kishore                                                                      26
    
    203                                                             Komal                                                                     28

How can I accomplish this?

Please help.

Thanks & Regards

 

anwarzamal25's picture
Joined: Sep 4 2015 - 2:15am
Last seen: 7 years 6 months ago

1 Answer:

You mast use Table component (jr:table) and set for column of table (jr:column) Column Print When expression like: $F{myFIeldStudentLastName} != null

Example here: community.jaspersoft.com/wiki/how-suppress-table-column-report

sanbez's picture
5668
Joined: Jan 11 2011 - 2:06am
Last seen: 2 years 5 months ago
Feedback
randomness