2006 IR Open Discussion Posted August 20, 2006 Share Posted August 20, 2006 By: Alexander Wallace - aows Show jasper viewer modally 2003-12-08 16:34 Is it possible to show the jasper viewer modally? Currently I register a window event listener to the viewer but it a pain if you have multiple viewers that shoudl show one after another. Thanks! By: Thomas Wegmueller - twegmueller RE: Show jasper viewer modally 2003-12-08 23:56 No, you can not without doing your own JasperViewer, as dori.jasper.view.JasperViewer is derived from javax.swing.JFrame - which can not (up until now) be made modal. Easiest solution is to take the source of dori.jasper.view.JasperViewer and change it to be derived from JDialog, or even take just the dori.jasper.view.JRViewer (which is a panel) and add that to a custom frame of yours. Regards! By: Alexander Wallace - aows RE: Show jasper viewer modally 2003-12-11 10:48 Thankyou... I tried putting the view inside of a dialog but then the print dialog is disabled... It can be displayed but no buttons in it worked.... Link to comment Share on other sites More sharing options...
alfonsofm24 Posted April 15, 2010 Share Posted April 15, 2010 Hi:To use JasperViewer with a modal jDialog all you have to do is remove the modal property to the jDialog before show the Jasper Viewer. Here is an example:jv = new JasperViewer(jp, false);setModal(false);jv.setTitle("Title");jv.setVisible(true);setModal(true);Wtih this you can have all the Jasper Viewer' s you need. Hope this help. Link to comment Share on other sites More sharing options...
alfonsofm24 Posted April 16, 2010 Share Posted April 16, 2010 Also you have to put to the jDialog the modalityType property MODELESS. Link to comment Share on other sites More sharing options...
g_girardini Posted November 28, 2023 Share Posted November 28, 2023 JasperViewer jv = new JasperViewer (jprint, false); jv.setModalExclusionType(ModalExclusionType.APPLICATION_EXCLUDE); jv.setVisible(true); This way, you can open a report from a modal dialog, and the report keeps excluded from the modal dialog, and you can save it or print it 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