JasperViewer - How to set file name and set the extension (format)?

后端 未结 2 648
深忆病人
深忆病人 2021-01-25 20:37

I am developing Java desktop based application using Swing framework and JasperReports for reporting. I have some problems, when JasperVie

2条回答
  •  萌比男神i
    2021-01-25 20:59

    For setting the default extension(s) to save to, one idea is that you need to somehow get the JRViewer instance from a JasperViewer (instance) and then, on the void JRViewer instance, you can set some save contributions. Have a look at JRViewer.setSaveContributors(JRSaveContributor[] saveContribs).

    For setting the file name, i am not entirely sure, but have a look at JRViewer.JRViewer(String, boolean).

    Also check the JRViewer and the JasperViewer source code, it may come in handy.

提交回复
热议问题