Jasper Report with Rest in Web service

0

Dear I have the following problem, it does not allow me to generate the jasper with a method that I have in the class from a rest service that is receiving parameters by means of an xml or json that another possibility is to generate the report from the xml that I'm receiving in the rest service attached code

stat is the class that receives the parameters

public class PjudGeneraReporte {

static Xmlbean xmlbean;

@GET
public Xmlbean leer(){
    return xmlbean;
} 


@POST
@Consumes({"application/xml","application/json"})
public Response guardar(Xmlbean x){

    xmlbean = x;
    xmlbean.getPlantilla();

    ProcesamientoReporte PR = new ProcesamientoReporte();
    try {
        PR.GeneraReporte();
    } catch (SQLException ex) {

        Logger.getLogger(PjudGeneraReporte.class.getName()).log(Level.SEVERE, null, ex);
    } catch (ClassNotFoundException ex) {

        Logger.getLogger(PjudGeneraReporte.class.getName()).log(Level.SEVERE, null, ex);
    }

    return Response.ok().build();
}

this class does not allow me to generate the attached report the report generating class

public class ProcessingReport {

 public void GeneraReporte() throws SQLException, ClassNotFoundException{

   try{

   JasperReport jasperReport = JasperCompileManager.compileReport("http://localhost:8080/PJUDireportws/WEB-INF/Reportes/reportearraigo.jrxml");

   Map<String, Object> parameters = new HashMap<String, Object>();
   parameters.clear();   

   String CRR_ARRAIGO = "505";

   parameters.put("CRR_ARRAIGO",CRR_ARRAIGO);
   JRDataSource dataSource = new JREmptyDataSource();
    JasperPrint jasperPrint = JasperFillManager.fillReport(jasperReport,parameters,OracleConnUtils.getOracleConnection( "10.13.251.210", "RPENQA", "judpenal","lucas10.5"));  
   File outDir = new File("http://localhost:8080/PJUDireportws/");
   outDir.mkdirs();

   JasperExportManager.exportReportToPdfFile(jasperPrint,"http://localhost:8080/PJUDireportws/reporteprueba2.pdf");

   }catch(Exception e){

   return;

   }
}

} this class generates the report which would be the problem that the report does not generate, there will be another way to generate the report

    
asked by Serk 06.09.2017 в 19:45
source

0 answers