Jump to content

how to decompile jasper file


alaa56mm

Recommended Posts

  • Replies 2
  • Created
  • Last Reply

Top Posters In This Topic

Popular Days

Top Posters In This Topic

use following code

 

Code:

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;

class JasperToJrxmlConverter
{
public static String sourcePath,outputPath;

public static JasperDesign jd = new JasperDesign();

public static void main(String [] args) {
Long executionStartTime=new Long(0);
Long executionStopTime=new Long(0);
// File Paths
sourcePath = "D:\JasperTest\Template3.jasper";
outputPath = "D:\JasperTest\Template3.jrxml";
try
{
executionStartTime=System.currentTimeMillis();
//JasperDesign jd=(JasperDesign)JRXmlLoader.load(sourcePath);
//JRXmlWriter.writeReport(jd, outputPath);
JasperReport jd = (JasperReport) JRLoader.loadObject(sourcePath);
JRXmlWriter.writeReport(jd, outputPath, "UTF-8"«»);
executionStopTime=System.currentTimeMillis();
System.out.println("Successfully Decompiled Jsaper File Into JRXML File : n"«»);
System.out.println("Total Time Taken Is : "+(executionStopTime-executionStartTime)+" msn"«»);
System.out.println(" JRXML File Name And Location Are :n"«»);
System.out.println(outputPath+"n"«»);
}
catch(JRException e)
{
e.printStackTrace();
}
}
}
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×
×
  • Create New...