biboo Posted May 11, 2008 Share Posted May 11, 2008 hi everyBody.. i have a problem to display my informations from the JTable (TableModel) in the jasperViewer... i started with Jasper 2 days ago so i need ur help..!! private void displayReport() { JasperPrint jasperPrint = generateReport(); JasperViewer jasperViewer = new JasperViewer(jasperPrint); jasperViewer.setVisible(true); } private JasperPrint generateReport() { JasperPrint jasperPrint = null; try {Map m= new HashMap(); m.put("Data source"," hello"); jasperPrint = JasperFillManager.fillReport("AircraftReportColumnIndex.jrxml",m,new JRTableModelDataSource(tmp)); //tmp TableModel de ma JTable } catch (JRException ee) { ee.printStackTrace(); } return jasperPrint; } ther's exception.. net.sf.jasperreports.engine.JRException: Error loading object from file : AircraftReportColumnIndex.jrxml Link to comment Share on other sites More sharing options...
lucianc Posted May 12, 2008 Share Posted May 12, 2008 JasperFillManager.fillReport expects the first argument to be that path to a compiled report (*.jasper) file, you have to first compile your report (see JasperCompileManager). HTH,Lucian Link to comment Share on other sites More sharing options...
biboo Posted May 13, 2008 Author Share Posted May 13, 2008 Sorry but i'm using iReport 2.0.5.. when i save my report , it indicate if i want to save it in .xml or .jrxml!! so i don't know how i save it in .jasper!! :blush: sorry , but i have to learn much more about the JasperReport.. nd how iReport nd Jasperreport works together, so plz help me! thnx Link to comment Share on other sites More sharing options...
lucianc Posted May 13, 2008 Share Posted May 13, 2008 You can compile the report in iReport by clicking the "Compile" button found before the "Execute" buttons. The compiled report will be saved in the directory configured as default compilation directory. If you intend to learn how JasperReports and iReport work, make sure you check the documentation pages here and here. Regards,Lucian Link to comment Share on other sites More sharing options...
biboo Posted May 14, 2008 Author Share Posted May 14, 2008 thnx lucianc, i do my best !! nd i hope find ur help when i need it!! a+ Link to comment Share on other sites More sharing options...
biboo Posted May 19, 2008 Author Share Posted May 19, 2008 hi, i generated a JasperViewer :P , but when i close it, the programme exit too! what can i do? Link to comment Share on other sites More sharing options...
lucianc Posted May 19, 2008 Share Posted May 19, 2008 See this FAQ. HTH,Lucian Link to comment Share on other sites More sharing options...
megalodon Posted May 19, 2008 Share Posted May 19, 2008 Hello!!!When I compile the file *.jrxml iReport generates a file *.bak, not *.jasper. How can I do it to take an *.jasper file??Thankx men! ;)Post edited by: megalodon, at: 2008/05/19 10:16 Link to comment Share on other sites More sharing options...
lucianc Posted May 20, 2008 Share Posted May 20, 2008 megalodon wrote:When I compile the file *.jrxml iReport generates a file *.bak, not *.jasper. How can I do it to take an *.jasper file? Are you looking into the compilation folder (see Options/Settings/Compiler)? Regards,Lucian Link to comment Share on other sites More sharing options...
biboo Posted May 23, 2008 Author Share Posted May 23, 2008 lucianc wrote:See this FAQ.HTH,Lucian problem resolved, thnx for ur help!!;) 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