Jump to content

JasperViewer save file formats


jovga

Recommended Posts

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

  • Replies 7
  • Created
  • Last Reply

Top Posters In This Topic

 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

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

  • 2 months later...

fahim_a
Wrote:

 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

  • 1 year later...
  • 5 weeks later...

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 account

Sign in

Already have an account? Sign in here.

Sign In Now

×
×
  • Create New...