jovga Posted January 24, 2010 Share Posted January 24, 2010 JasperViewer allows to save report in few files format. I need to remove from that list unnecessary formats (docx, xml, html, etc.). I would like to provide export only to pdf and odt. How to do that ? How to remove from JasperViewe, save JFileChooser formats that I don't need? Link to comment Share on other sites More sharing options...
fahim_a Posted January 26, 2010 Share Posted January 26, 2010 You can simply remove the save contributor from your JRViewer instance...Code: while (i.hasNext()) { JRSaveContributor jsc = i.next(); if (PERMITTED_FILE_TYPES_LIST.contains(jsc.getDescription())) { continue; } else viewer.removeSaveContributor(jsc); } Link to comment Share on other sites More sharing options...
fahim_a Posted January 26, 2010 Share Posted January 26, 2010 Oops...forgot to copy the start of that code sectionCode: List<JRSaveContributor> saveOptions = Arrays.asList(viewer.getSaveContributors()); Iterator<JRSaveContributor> i = saveOptions.iterator(); Link to comment Share on other sites More sharing options...
fahim_a Posted January 26, 2010 Share Posted January 26, 2010 Code: private final String PDF = "PDF (*.pdf)"; private final String RTF = "RTF (*.rtf)"; private final String HTML = "HTML (*.htm, *.html)"; private final String XLS = "Single sheet XLS (*.xls)"; private final String CSV = "CSV (*.csv)"; private final List<String> PERMITTED_FILE_TYPES_LIST = Arrays.asList(PDF, RTF, HTML, XLS, CSV); Link to comment Share on other sites More sharing options...
jovga Posted January 26, 2010 Author Share Posted January 26, 2010 Thank You very much, it realy help me. Link to comment Share on other sites More sharing options...
carlosvlab Posted March 31, 2010 Share Posted March 31, 2010 fahim_aWrote: You can simply remove the save contributor from your JRViewer instance... Code: Ok, it's in a JRViewer object,but, how can I do the same in a JasperViewer obcect? because I'm using this object to show the report with NetBaens&IceFaces , like this way: JasperViewer jasperViewer = new JasperViewer(masterPrint, false); jasperViewer.setTitle("My Report Title"); jasperViewer.setVisible(true); So... how can I customize the formats file to save my report from JasperViewer? tnx in advance!Post Edited by carlosvlab at 03/31/2010 00:22 Link to comment Share on other sites More sharing options...
jellychai Posted July 2, 2011 Share Posted July 2, 2011 RemoveSaveContributor() is undefined in my JRViewer. May i know what is going wrong with my JRViewer? My jar file is jasperreports-3.7.6.jar.JRViewer.java (version 1.5 : 49.0, super bit) Thanks. Link to comment Share on other sites More sharing options...
noa123 Posted July 31, 2011 Share Posted July 31, 2011 Hi ,Is there a way to change the save contributes names?thank's. 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