Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- @Service
- public class ReportSolicitation {
- private JasperReport solicitationReport;
- @PostConstruct
- private void initReport() {
- try {
- solicitationReport = JasperCompileManager
- .compileReport(FilesLoader.getInputStreamFromPath("/static-files/record.jrxml"));
- } catch (Exception e) {
- }
- }
- public byte[] getReport() {
- // dynamic parameters required for report
- Map<String, Object> empParams = new HashMap<String, Object>();
- empParams.put("Field", "Value");
- byte[] bytesFile;
- try {
- JasperPrint empReport = JasperFillManager.fillReport(solicitationReport, empParams,
- new JREmptyDataSource());
- bytesFile = JasperExportManager.exportReportToPdf(empReport);
- } catch (JRException e) {
- }
- return bytesFile;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement