有没有办法禁用 jasperreport 查看器工具栏中的保存按钮中的文件过滤器选项

发布于 2024-12-24 17:07:40 字数 262 浏览 3 评论 0原文

我想知道是否有任何方法可以删除不同格式类型的保存按钮选项文件中的 pdf,xls ,这样我就不想在 pdf singlesheet-xls 中生成报告。

一般来说,类型选项的默认保存按钮文件带有所有格式 -pdf、单页 xls、嵌入图像、jrxml、多页 xls、csv 和其他格式。 我想要的是禁用 pdf 和 singlesheet xls。有没有办法禁用 ireport 中的某些格式

I would like to know is there any way to remove pdf,xls in save button option files of type different formats so that i dont want to generate reports in pdf singlesheet-xls.

Generally the default save button files of type option comes with all the formats -pdf,singlesheet xls,embedded images,jrxml,multiplesheet xls,csv and other formats.
what i want is to disable pdf and singlesheet xls.is there any way to disable certain formats in ireport

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

始终不够 2024-12-31 17:07:40

此示例删除除单页 XLSPDF 之外的所有保存选项:

JRViewer viewer = ... ;//your viewer
JRSaveContributor[] contrbs = viewer.getSaveContributors();

for (JRSaveContributor saveContributor : contrbs)
{
    if (!(saveContributor instanceof net.sf.jasperreports.view.save.JRSingleSheetXlsSaveContributor 
            || saveContributor instanceof net.sf.jasperreports.view.save.JRPdfSaveContributor))
        viewer.removeSaveContributor(saveContributor);
}

This example removes all save options apart from Single sheet XLS and PDF:

JRViewer viewer = ... ;//your viewer
JRSaveContributor[] contrbs = viewer.getSaveContributors();

for (JRSaveContributor saveContributor : contrbs)
{
    if (!(saveContributor instanceof net.sf.jasperreports.view.save.JRSingleSheetXlsSaveContributor 
            || saveContributor instanceof net.sf.jasperreports.view.save.JRPdfSaveContributor))
        viewer.removeSaveContributor(saveContributor);
}
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文