You are not logged in.
Hi,
Is there any way to disable report preview button or something like this? We have only birt and dynamic lists, now we are using this script:
import net.datenwerke.rs.core.service.reportmanager.exceptions.*;
import net.datenwerke.rs.core.service.reportmanager.hooks.*;
import net.datenwerke.rs.base.service.reportengines.table.TableReportUtils;
import net.datenwerke.rs.core.service.reportmanager.entities.reports.Report;
import net.datenwerke.rs.base.client.reportengines.table.dto.TableReportInformation;
import net.datenwerke.rs.core.service.reportmanager.ReportService;
def HOOK_NAME = "DisableReportPreviewHook"
def callback = [
notifyOfReportExecution : { report, parameterSet, user, outputFormat, configs -> },
notifyOfReportsSuccessfulExecution : { compiledReport, report, parameterSet, user, outputFormat, configs -> },
notifyOfReportsUnsuccessfulExecution : { e, report, parameterSet, user, outputFormat, configs -> },
doVetoReportExecution: {report, parameterSet, user, outputFormat, configs ->
TableReportUtils tableReportUtils = GLOBALS.getInstance(TableReportUtils.class);
ReportService reportService = GLOBALS.getInstance(ReportService.class);
if (outputFormat.equals("RS_TABLE") || outputFormat.equals("PDF")) {
throw new ReportExecutorException("Preview or PDF is not available. Use the Excel format");
}
}
] as ReportExecutionNotificationHook
GLOBALS.services.callbackRegistry.attachHook(HOOK_NAME, ReportExecutionNotificationHook.class, callback)
The logic behind this script was that the preview of BIRT reports is rendered in pdf format, so you can simply block the report execution in pdf format, however sometimes we need to get some reports in pdf file.
I know I can add user exceptions so that certain people can execute PDF reports, but I'm wondering if there's a way to disable previews altogether?
Last edited by eugenev (2025-06-17 11:09:41)
Offline
Hi eugenev,
pls check here:
https://reportserver.net/releasenotes/R … essPreview
and here:
https://reportserver.net/de/guides/admi … erties.php
suppress_automatic_preview
Allows to disable the automatic preview of the report (defaults to false). Setting this option to ''true'' prevents the report from automatically executing upon opening from within the Administration panel or a TeamSpace. This capability is particularly beneficial in situations where reports generated by Birt, JXLS, Jasper, or Crystal have extended execution times, and users simply wish to export the report without initiating its direct execution. It's important to note that when automatic preview is disabled, users can still manually trigger previews by explicitly clicking on "Preview" or the "Refresh preview" button. Furthermore, it's noteworthy that dynamic lists cannot have their preview functionality disabled, as users are always required to explicitly click on "Preview".
Regards,
Eduardo
Offline