land-of-mordor Posted May 8, 2012 Share Posted May 8, 2012 I'm coding an application using Netbeans as IDE to deal and interchange data between an Access database and a PBX software that uses firebird. Everything was fine until I reached the reports issue.Working in Netbeans IDE everything worked really fine. Report is created and converted to the file type I wanted (rtf, odt, pdf...), but when a take the content of the "dist" folder (where the compiled application is stored by Netbeans with all the needed libraries) and execute the application, the report is created sucessfully but when it try to save it as PDF file, the only output is a empty (0 kb occupied) PDF file. I tried with other file types, like rtf and odt, and the application works great in both situations, runned using Netbeans IDE and as a stand-alone application.Is there an specific library or reference that is loaded in Netbeans IDE but not imported when compiled as a stand-alone application? may be is another silly thing? any help or thoughts?Thanks.Code://IMPORT SECTIONpackage contactosagenda;import java.awt.Cursor;import java.awt.Desktop;import java.io.File;import java.util.logging.Level;import java.util.logging.Logger;import javax.swing.ImageIcon;import javax.swing.JOptionPane;import javax.swing.UIManager;import javax.swing.plaf.DesktopPaneUI;import net.sf.jasperreports.engine.*;import net.sf.jasperreports.engine.export.JRPdfExporter;import net.sf.jasperreports.engine.util.JRLoader;import net.sf.jasperreports.engine.export.oasis.JROdtExporter;//REPORT LAUNCHERprivate void lanzaInforme(Clientes listado){ try { JasperReport informe = (JasperReport)JRLoader.loadObject(new File(System.getProperties().getProperty("user.dir") + System.getProperty("file.separator")+"reportClientes.jasper")); JRDataSource j = listado.getReportDataSource(); JasperPrint reportPrint = JasperFillManager.fillReport(informe,null,j); //JRExporter export = new JRPdfExporter(); //JRExporter export = new JRRtfExporter(); JRExporter export = new JROdtExporter(); export.setParameter(JRExporterParameter.JASPER_PRINT, reportPrint); String ruta = System.getProperties().getProperty("user.dir") + System.getProperty("file.separator") + "temp.odt"; //File f = File(ruta); export.setParameter(JRExporterParameter.OUTPUT_FILE, new File(ruta)); export.exportReport(); //Desktop.getDesktop().open(new File(ruta)); //JOptionPane.showMessageDialog(this.getParent(),"El archivo debe estar en\n" + f.getPath()); } catch (Exception ex) { JOptionPane.showMessageDialog(this.getParent(), "Se ha producido el siguiente error:\n" + ex); Logger.getLogger(Principal.class.getName()).log(Level.SEVERE, null, ex); } } Link to comment Share on other sites More sharing options...
Peetzer Posted May 10, 2012 Share Posted May 10, 2012 I don't know if this is related, are you using the latest Adobe Reader 10 (10.1.3)? With previous 10 version you could get empty pdf's but only with IE. Link to comment Share on other sites More sharing options...
land-of-mordor Posted May 10, 2012 Author Share Posted May 10, 2012 Thanks for replying!! I think my problem it's not related with the issue you saying. I'm not using any web-related stuff, just a simply application to be run on a desktop. So I think the Adobe version I've installed in the PC won't be the cause. But this afternoon I'll update Adobe Reader and see what happend. Link to comment Share on other sites More sharing options...
land-of-mordor Posted May 16, 2012 Author Share Posted May 16, 2012 As I say before, updating Adobe Reader didn't fix the issue. This is quite strange...I don't know what to do... Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now