我需要在Jasperreport中获得base64结果。它为我工作。为此,我使用了2个步骤。
我的问题是我想在不写desc的情况下获得base64结果(需要从上面跳过step1)。
这是我的代码
JasperReport jasperReport = JasperCompileManager.compileReport("D://PremWorkSpace/PdfCreation/myreport.jrxml");
HashMap reportMap = new HashMap<String, Object>();
reportMap.put("name", "Premkumar Manipillai");
JRDataSource dataSource = new JREmptyDataSource();
JasperPrint jasperPrint = JasperFillManager.fillReport(jasperReport, reportMap, dataSource);
File outDir = new File("D:/PremWorkSpace/PdfCreation/");
outDir.mkdirs();
JasperExportManager.exportReportToPdfFile(jasperPrint, "D:/PremWorkSpace/PdfCreation/" + "Topup_Nach.pdf");
System.out.println("Report Saved!");
String base64ImageString = encoder("D:/PremWorkSpace/PdfCreation/" + "Topup_Nach.pdf");