Jump to content
JasperReports Library 7.0 is now available ×

Problem using XML


2005 IR Help

Recommended Posts

By: sadsd - micasa

Problem using XML

2005-06-01 10:05

I've been able to create the jasper file with ireport, and everything seems to be working fine, until i try to make a pdf file from my jsp aplication.

 

Could someone tell me what i'm i doing wrong in this code?

thanxs

 

 

try {

String reportFile = application.getRealPath("/intranet/listadospdf/prueba.jasper");

Map parameters = new HashMap();

String outFileName = application.getRealPath("/intranet/listadospdf/prueba.pdf");

String xmlFileName = "C:\prueba.xml";

String recordPath = "/addressbook/person";

 

JRXMLDataSource jrxmlds = new JRXMLDataSource(xmlFileName,recordPath);

System.out.println("lalalala"+jrxmlds.getActualPath());

 

JasperPrint print = JasperFillManager.fillReport(reportFile,parameters,jrxmlds);

JRExporter exporter = new net.sf.jasperreports.engine.export.JRPdfExporter();

exporter.setParameter(JRExporterParameter.OUTPUT_FILE_NAME,outFileName);

exporter.setParameter(JRExporterParameter.JASPER_PRINT,print);

exporter.exportReport();

 

accion = "";

} catch (Exception e) {

System.out.println("ERROR AL GENERRR EL INFORME > FACTURAS_COBROS <, "+e.toString());

e.printStackTrace();

}

 

 

 

 

 

By: Giulio Toffoli - gt78

RE: Problem using XML

2005-06-01 15:50

 

Do you have a stacktrace?

 

Giulio

 

 

 

 

 

 

By: sadsd - micasa

RE: Problem using XML

2005-06-01 23:39

That's my problem i don't get any error message, everything seems to be working right but it doesnt print the data from the xml. It works fine when i do it at the ireport, but i can't get it to work on my jsp aplication. (so i guess it has something to do with the code i'm using there). I thought about a problem with librarys but i'm using the same ones on my tomcat.

 

Thanxs

 

 

 

 

By: sadsd - micasa

RE: Problem using XML

2005-06-02 08:20

I've been able to generate the pdf, but the data from the xml won't get printed. It's strange couse when i create the pdf thru ireport it works fine, it prints the correct info from the xml.

But its different when i do it from my web application, the info wont get printed. does some one had this problem before?

thanxs for your help

 

 

 

 

By: sadsd - micasa

RE: Problem using XML

2005-06-07 06:33

I've solved the problem, i?ve made it work on mi internet aplication.

There's a problem with ireport when you use a xml data source, if you see the results correctly on ireport it wont be shown on the web, it's really strange.

Link to comment
Share on other sites

  • Replies 0
  • Created
  • Last Reply

Top Posters In This Topic

Popular Days

Top Posters In This Topic

Popular Days

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...