Senin, 14 Februari 2011

Kismiss Dynamic Field

At this section, kismiss introduce a feature to define field to be shown dynamically. We choose the field(s) to generated to report. This feature is easy to use and simple to implement.
This feature can be used by calling the “setVisibleField” method in the report instance. Code will look like :

   KismissReport report = KismissReport.getInstance();
     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);

This example tell us that the fields to be shown in report are “id”, “firstName”, “lastName”, and “capacity” only. Kismiss will generate the report based on field name of the report declared in JavaBean. See the following report :




Tidak ada komentar:

Posting Komentar