thiagot Posted June 13, 2007 Share Posted June 13, 2007 Hello, I need a hand here. My application is using JasperViewer but his XLS exporter isn't working well. The cells with any pattern (dd/MM/yyyy or ###0,00) comes with a single quote before the value in XLS (like '04/10/1999). I made a code that sets the IS_DETECT_CELL_TYPE to true (exporter.setParameter(JRXlsExporterParameter.IS_DETECT_CELL_TYPE, true) and generated a XLS file with it and worked just fine! :) The problem is that I need to do it using JasperViewer, I must add this parameter to the JasperViewer's XLS exporter. :( Is there any way that can be done? Thanks,Thiago Link to comment Share on other sites More sharing options...
szaharia Posted June 13, 2007 Share Posted June 13, 2007 At this moment it cannot be done without modifying by hand the JRViewer class, I'm afraid.You could post a feature request here http://jasperforge.org/sf/tracker/do/listArtifacts/projects.jasperreports/tracker.feature_requests. Best regards,sanda Link to comment Share on other sites More sharing options...
Teodor Danciu Posted June 13, 2007 Share Posted June 13, 2007 Hi, You can customize the way documents are exported from the Swing viewer by implementing and then registering a custom "save contributor".In JasperReports, the reusable viewer component is not exactly the JasperViewer class, but rather the JRViewer panel.You can instantiate the JRViewer and remove the existing XLS save contributors and add a JRSaveContributor implementation of your own, that would even prompt you for export options using a dialog.You can try implement your save contributor by looking into the ones we ship with the library by default. I hope this helps.Teodor Link to comment Share on other sites More sharing options...
thiagot Posted June 13, 2007 Author Share Posted June 13, 2007 Hi, First of all, thanks a lot for the reply. One thing, how can I retrieve the reference of the JRViewer within my JasperViewer? So I can get it to call the method addSaveContributor(mySaveContributor). Code:JasperViewer jrviewer = new JasperViewer(print, false);jrviewer.setVisible(true); I can't get the reference to the JRViewer in my "jrviewer".Will I have to change the source of the JRViewer.java and JasperViewer.java? Thanks a lot,Thiago Link to comment Share on other sites More sharing options...
szaharia Posted June 14, 2007 Share Posted June 14, 2007 Hi, the JRViewer member was private, indeed. We modified this to be protected, and changes were committed here.You could use either the latest version of the JasperViewer class, or you can create your own class which extends the old JasperViewer, having a much more visible JRViewer member. Thank you,sanda Link to comment Share on other sites More sharing options...
thiagot Posted June 27, 2007 Author Share Posted June 27, 2007 Thanks a lot!!!That will do :D Thiago 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