At this section, we will be shown how to add sub title to enhance information of the report. We just need to add some rows of code. Let's see the code below :
KismissReport report = KismissReport.getInstance();
List<Object> subs = new ArrayList<Object>();
subs.add("Business Developement Indicator");
params.put(ReportFactory.SUB_TITLE, subs);
params.put(ReportFactory.TITLE, "TEST KISMISS REPORT");
params.put(ReportFactory.INFOTITLE, "Report");
params.put(ReportFactory.REPORT_NAME, "employeeTest.pdf");
report.setVisibleField(new String[]{"id","firstName","lastName","capacity"});
report.generateAnnotatedPdfFiles(Employee.class, employees, "D:/Personal/Test/", params, group);
When we run the above code, our report will be added “Business Developement Indicator” as our report's subtitle, see the result below :
KismissReport report = KismissReport.getInstance();
List<Object> subs = new ArrayList<Object>();
subs.add("Business Developement Indicator");
subs.add(new SubTitle("Print Date :"+new SimpleDateFormat("dd MMM yyyy hh:mm:ss").format(new Date()), "Print By : Hong Kisman"));
params.put(ReportFactory.SUB_TITLE, subs);
params.put(ReportFactory.TITLE, "TEST KISMISS REPORT");
params.put(ReportFactory.INFOTITLE, "Report");
params.put(ReportFactory.REPORT_NAME, "employeeTest.pdf");
report.setVisibleField(new String[]{"id","firstName","lastName","capacity"});
report.generateAnnotatedPdfFiles(Employee.class, employees, "D:/Personal/Test/", params, group);
At the code above, we add a SubTitle instance class to sub title collection, the report we print “Print Date” at the left side and “Print By” at the right side.
Let's see the report result as follow :