Is there any way to disable report preview?

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?

Hi eugenev,

pls check here:
https://reportserver.net/releasenotes/RS4.7.0.html#suppressPreview

and here:
https://reportserver.net/de/guides/admin/chapters/Report-Properties.php

Regards,
Eduardo