Print Graphics JasperReport

0

I had doubts about how I could print a GRAPH with JasperReport, I looked for the way but only show how to make them but not how to print them, I will leave here the way I print the REPORTS with JasperReport and thus create the idea of what I want to do , if I do not explain myself.

PAGE JSP

<%@page import="net.sf.jasperreports.engine.JasperRunManager"%>
<%@page import="java.util.*"%>
<%@page import="java.io.File"%>
<%@page import="com.conexion.Conexion"%>
<%@page contentType="text/html" pageEncoding="UTF-8"%>
<!DOCTYPE>
<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <title>JSP Page</title>
    </head>
    <body>
        Conexion c= new Conexion();
        c.conectar();
        File reporte= new File(application.getRealPath("reportes/clientesRegistrados.jasper"));
        Map parametros=new HashMap();
        byte[] bytes= JasperRunManager.runReportToPdf(reporte.getPath(), parametros,c.getCon());
        response.setContentType("application/pdf");
        response.setContentLength(bytes.length);
        ServletOutputStream output=response.getOutputStream();
        response.getOutputStream();
        output.write(bytes,0, bytes.length);
        output.flush();
        output.close();
</body>
    </html>
    
asked by Michell Urbina 12.10.2018 в 20:16
source

0 answers