sharwood Posted August 18, 2006 Share Posted August 18, 2006 When i close the jasperviewer report that is opened up, my main application window is closed at the same time. Is there anyway to stop this.Also, i have chosen adobe as my external pdf reader, id there anyway to use adobe to view these, rather than the jasper viewer? Thanks! Link to comment Share on other sites More sharing options...
christiaan_se Posted August 18, 2006 Share Posted August 18, 2006 Hi,in the constructor of JasperViewer there is boolean indicating whehter it should perform an exit on close. With the viewer you can't view pdf files, you just view the jasper reports. To view pdf files you probably need to use something like JDIC or get a (commercial and most of the times pretty expensive) java implementation of a pdf viewer. There used to be a nice java-com bridge available (njawin) which is now commercially available (http://www.javain.com). kind regards,Christiaan Link to comment Share on other sites More sharing options...
sharwood Posted August 22, 2006 Author Share Posted August 22, 2006 Hey, thanks for your help, but i still cant figure it out. I can see the constructer takes a boolean, so I tried: JasperViewer jv = new JasperViewer(jasperPrint, false); but it still closes...I tried "true" aswell Help would be much appreciated. Link to comment Share on other sites More sharing options...
loonyew Posted August 26, 2006 Share Posted August 26, 2006 try this..hehe...hope it helps jasperReport = JasperCompileManager.compileReport( "reportloh.jrxml");jasperPrint = JasperFillManager.fillReport( jasperReport, parameters, conn);JasperViewer jv = new JasperViewer( jasperPrint, false );jv.viewReport( jasperPrint, false ); dont know why the viewReport need to specify the jasperPrinter and booolean again...hehe....but this is the way...hehe...:PPost edited by: loonyew, at: 2006/08/26 11:34 Link to comment Share on other sites More sharing options...
lucianc Posted August 28, 2006 Share Posted August 28, 2006 viewReport(JasperPrint, boolean) is a static method of JasperViewer, therefore doing jv.viewReport(..) doesn't make sense and the JasperViewer instance you create is useless. What you should do is JasperViewer.viewReport(jasperPrint, false). HTH,Lucian Link to comment Share on other sites More sharing options...
freakwheel Posted August 6, 2013 Share Posted August 6, 2013 Thanks mate. Link to comment Share on other sites More sharing options...
omardlt1 Posted June 1, 2014 Share Posted June 1, 2014 Absolutely beautiful. Don't know if this is a quick fix or the actual preferred method, but its working wonders with my app (final project prototype). Thanks again! Link to comment Share on other sites More sharing options...
shane.anandappa Posted August 17, 2014 Share Posted August 17, 2014 Have been looking for this solution for hours. Worked well for me. Thank you for your valued contribution. Shane Link to comment Share on other sites More sharing options...
mkomadi29 Posted December 3, 2014 Share Posted December 3, 2014 it works, thx :))) Link to comment Share on other sites More sharing options...
lourens.ober Posted September 22, 2015 Share Posted September 22, 2015 Or you can use: JasperViewer jasperViewer = new JasperViewer(jasperPrint, false); jasperViewer.setVisible(true); 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