Ver Mensaje Individual
  #1 (permalink)  
Antiguo 19/04/2013, 14:55
Geovanny0401
 
Fecha de Ingreso: diciembre-2009
Mensajes: 137
Antigüedad: 15 años, 3 meses
Puntos: 4
error a convertir un archivo jasper a jrxml

Bueno, hoy tengo un problema en vez de borrar los compilados (.jasper), he borrado los fuentes (.jrxml) de los informes en Jasper.

He intentado recuperarlos y no he podido busque en la web y encontre este codigo
Código PHP:
import net.sf.jasperreports.engine.JRException;
import net.sf.jasperreports.engine.JasperReport;
import net.sf.jasperreports.engine.design.JasperDesign;
import net.sf.jasperreports.engine.util.JRLoader;
import net.sf.jasperreports.engine.xml.JRXmlWriter;

public class 
convertir {
public static 
String sourcePathdestinationPathxml;
public static 
JasperDesign jd = new JasperDesign();
public static 
void main(String[] argsthrows Exception {
        
sourcePath "Prueba/src/reportes/reporte.jasper";
        
destinationPath "Prueba/src/reportes/reporte.jrxml";
        try {
          
JasperReport report = (JasperReportJRLoader.loadObject(sourcePath);
          
JRXmlWriter.writeReport(reportdestinationPath"UTF-8");
        } catch (
JRException e) {
             throw new 
Exception("Error: " e.getMessage());
      }
  }

Y busque de otra forma con el editor de jasperReport la version 5 y nada se me ha hecho muy dificil y no se que version del arhivo es como eso lo hice hace mas de 2 años total…