nockdg Posted May 12, 2008 Share Posted May 12, 2008 Hi, We use the JRViewer class to display reports to users. What we need to be able to do is detect if they have clicked print from here. Is this possible? As btnPrintActionPerformed is not public we can't override it and still call the super code. Thx Link to comment Share on other sites More sharing options...
lucianc Posted May 12, 2008 Share Posted May 12, 2008 You can extend JRViewer and add another listener to btnPrint, which is protected. Regards,Lucian Link to comment Share on other sites More sharing options...
nockdg Posted May 13, 2008 Author Share Posted May 13, 2008 Yep, that works nicely. Is it then possible to detect that the user actually printed the report rather than canceling the print dialog? Thx Link to comment Share on other sites More sharing options...
lucianc Posted May 13, 2008 Share Posted May 13, 2008 You can do that as well if you use JR >= 2.0.5 by removing the default btnPrint action listener, and adding a different action listener that performs the printing via JRPrintServiceExporter instead of JasperPrintManager, and checks the print status via JRPrintServiceExporter.getPrintStatus(). HTH,Lucian Link to comment Share on other sites More sharing options...
nockdg Posted May 14, 2008 Author Share Posted May 14, 2008 Thanks for this, will give it a try. Dave 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