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 sourcePath, destinationPath, xml;
public static JasperDesign jd = new JasperDesign();
public static void main(String[] args) throws Exception {
sourcePath = "Prueba/src/reportes/reporte.jasper";
destinationPath = "Prueba/src/reportes/reporte.jrxml";
try {
JasperReport report = (JasperReport) JRLoader.loadObject(sourcePath);
JRXmlWriter.writeReport(report, destinationPath, "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…