/ Published in: Java
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
import net.sf.jasperreports.engine.JRException; import net.sf.jasperreports.engine.design.JasperDesign; import net.sf.jasperreports.engine.xml.JRXmlLoader; import net.sf.jasperreports.engine.xml.JRXmlWriter; import net.sf.jasperreports.engine.util.JRLoader; import net.sf.jasperreports.engine.JasperReport; class JasperToXml { public static JasperDesign jd = new JasperDesign(); // Paths sourcePath = "C:\Documents and Settings\user\My Documents\workspaces\jasper\File1.jasper"; outputPath = "C:\Documents and Settings\user\My Documents\workspaces\jrxml\File2.jrxml"; try { // for converting a JasperReport object (compiled .jasper file) to a JasperDesign object jd = JRXmlLoader.load(sourcePath); // is this the right way to do it??? } catch(JRException e) { e.printStackTrace(); } JRXmlWriter.writeReport(jd, outputPath); // } }
URL: http://jasperforge.org/plugins/espforum/view.php?group_id=102&forumid=103&topicid=25854