0

I compiled my .jasper and filled it with parameters. Here I am converting it to pdf as a byte array:

    Map<String, Object> parameters = new HashMap<>();
    parameters.put("name", (employee.getFirstName() + " " + employee.getLastName()));
    byte[] content = new byte[0];
    JasperPrint jasperPrint = JasperFillManager
        .fillReport(resourceFile.getInputStream(), parameters, new JREmptyDataSource());
    content = JasperExportManager.exportReportToPdf(jasperPrint);

After converting it to byte array I want to get the filled parameters for my unit tests.

Is it possible? If yes, how can I do such a thing?

Help is very much appreciated : )

Alex K
  • 22,315
  • 19
  • 108
  • 236
Hamza Belmellouki
  • 2,516
  • 1
  • 18
  • 39
  • `After converting it to byte array I want to get the filled parameters for my unit tests` - What do you mean? Do you want to grab data from pdf file? – Alex K Jun 18 '21 at 11:14
  • Using Jasper Export Manager, I've converted .jasper to pdf(byte array). Previously, I've defined parameters in Jasper Studio. And I've filled them(see `parameters` map). Now, I want to get them back from the pdf (byte array). Is that possible? – Hamza Belmellouki Jun 18 '21 at 11:24

0 Answers0