0

This is my data object

public class CandidateExcelModel {
    private int id;
    private String name;    //varchar(50)
    private String email; //   varchar(100)
    private Date dob; //    date  
    private List<String> skill = new ArrayList<String>();
}

My dynamic report:

   for (Iterator<SkillDO> it = job.getSkills().iterator(); it.hasNext();) {
        SkillDO skills = it.next();
        columns.add(ColumnBuilder.getNew().setColumnProperty(skills.getName(), String.class.getName())
                .setTitle(skills.getName()).setWidth(new Integer(90))
                .addConditionalStyles(conditionalStyles)
                .build());
    }

    drb.addColumn("Id", "id", Integer.class.getName(), 10)
            .addColumn("Name", "name", String.class.getName(), 100)
            .addColumn("E-mail", "email", String.class.getName(), 100)
            .addColumn("dob", "dob", Date.class.getName(), 50)
            .addColumn("Phone Number ", "phoneNumber", String.class.getName(), 25)
            .addColumn("Alternate Number", "alternateNumber", String.class.getName(), 25)
            .addColumn("Address Line", "addressLine", String.class.getName(), 100)
            .setPrintColumnNames(true)
            .setIgnorePagination(true)
            .setMargins(0, 0, 0, 0)
            .setTitle("Sales Report")
            .setUseFullPageWidth(true);
    for (AbstractColumn column : columns) {
        drb.addColumn(column);
    }

How to populate this data to report using DynamicJasper? As it contains list but it should be with no list. The skill can only be present in list as it can be variable

Alex K
  • 22,315
  • 19
  • 108
  • 236
deepak kumar
  • 229
  • 2
  • 3
  • 12

1 Answers1

1

Please specify how yo want that list to be shown on the report (i.e. comma sepparated?). You can declare the field as object ( .addField("skill", Object.class) ) and later add a CustomExpressionColumn or a column with a ValueFormatter where you downcast the "skill" to List and do whatever you want with the list to finally return a string value

Dj Mamana
  • 339
  • 1
  • 8