Reports addon available?

Does the current JMix release include the Reports addon ?


The Reporting add-on is in the phase of testing and stabilitization, and it’s not published yet. It will appear at when it’s ready.

1 Like

I’ve done the job with jasper reports and call the report with jasper class directly
Suppose you have the jasper report file called “report”, add the xml definition to resources folder in a file called “report.jrxml”.

Put the code in a java class for the report generation

public class ReportCustomerService {

private DataManager dataManager;
protected JasperPrint jasperPrint;

public void exportReport() throws JRException, IOException {

    List<Customer> customerlist = dataManager.load(Customer.class)
                        .query("select e from customer e ")

    ClassLoader classLoader = getClass().getClassLoader();
    InputStream url = null;
    url = classLoader.getResourceAsStream("report.jrxml");
    JasperReport jasperReport = JasperCompileManager.compileReport(url);
    JRBeanCollectionDataSource dataSource = new JRBeanCollectionDataSource(customerlist);
    Map<String, Object> parameters =new HashMap<>();
    this.jasperPrint = JasperFillManager.fillReport(jasperReport,parameters,dataSource);
    return ;


@RequestMapping(value = "/report", method = RequestMethod.GET,produces = MediaType.APPLICATION_PDF_VALUE)
public ResponseEntity<InputStreamResource> getDocument() throws JRException {

    ByteArrayOutputStream out = new ByteArrayOutputStream();
    JasperExportManager.exportReportToPdfStream(this.jasperPrint, out);;
    ByteArrayInputStream bis = new ByteArrayInputStream(out.toByteArray());

    HttpHeaders headers = new HttpHeaders();
    headers.add("Content-Disposition", "inline; filename=report.pdf");

    return ResponseEntity
            .body(new InputStreamResource(bis));



Then call the report from your form

inject the ReportCustomerService class in the controller
private ReportCustomerService reportCustomerService;

public void onBtnGenerateReportClick(Button.ClickEvent event) throws JRException, IOException {

    webBrowserTools.showWebPage("/report", ParamsMap.of("_target", "blank"));