public void showApplicantCountVsJobBoardsSimpleReport(Collection<ApplicantCountVsJobBoardsDTO> applicantCountVsJobBoardsList,HttpServletRequest request) throws ColumnBuilderException,ClassNotFoundException, JRException {
initStyles();
FastReportBuilder drb = new FastReportBuilder();
setTitleProperties(drb,"Job Board by Company and Job Title");
reportTitle = "Job-Board-by-Company-and-Job-Title";
DynamicReport dr = createApplicantCountVsJobBoardsSimpleReport(drb, applicantCountVsJobBoardsList);
jp = DynamicJasperHelper.generateJasperPrint(dr, new ClassicLayoutManager(), new JRBeanCollectionDataSource(applicantCountVsJobBoardsList));
request.getSession().setAttribute("JasperPrintObject", jp);
request.getSession().setAttribute("ReportName", reportTitle);
displayReport(request, 0);
}
private DynamicReport createApplicantCountVsJobBoardsSimpleReport(FastReportBuilder drb, Collection<ApplicantCountVsJobBoardsDTO> applicantCountVsJobBoardsList) {
AbstractColumn columnCompanyName = setStringColumnProperties("companyName","Company Name",100);
drb.addColumn(columnCompanyName);
AbstractColumn columnJobTitle = setStringColumnProperties("jobName","Job Title",200);
drb.addColumn(columnJobTitle);
AbstractColumn columnTotal = setStringColumnProperties("totalApplicantForJob","Total",100);
drb.addColumn(columnTotal);
return drb.build();
}
public class ApplicantCountVsJobBoardsDTO {
private String companyName;
private String jobName;
private Integer totalApplicantForJob;
private HashMap<String, Integer> jobBoard;
public String getCompanyName() {
return companyName;
}
public void setCompanyName(String companyName) {
this.companyName = companyName;
}
public String getJobName() {
return jobName;
}
public void setJobName(String jobName) {
this.jobName = jobName;
}
public Integer getTotalApplicantForJob() {
return totalApplicantForJob;
}
public void setTotalApplicantForJob(Integer totalApplicantForJob) {
this.totalApplicantForJob = totalApplicantForJob;
}
public HashMap<String, Integer> getJobBoard() {
return jobBoard;
}
public void setJobBoard(HashMap<String, Integer> jobBoard) {
this.jobBoard = jobBoard;
}
}
我不知道将 jobBoard 项目添加到报告中。jobBoard 对象中的每个项目都将成为我报告中的一列。请帮我。我是贾斯珀的新手。:(
我正在使用net.sf.jasperreports
和ar.com.fdvs.dj
罐子