#1 2015-03-23 18:26:25

awilcox
Member
Registered: 2015-03-02

ReportExecutionNotificationHook - report key null in report parameter

I have implemented a ReportExecutionNotificationHook script, defining the callback as follows:

def callback = [
        notifyOfReportExecution : { report , parameterSet , user , outputFormat , configs -> },
        notifyOfReportsSuccessfulExecution : { compiledReport , report , parameterSet , user , outputFormat , configs ->
            re.reportExecution(true, report, user, parameterSet);
        },
        notifyOfReportsUnsuccessfulExecution : { e, report , parameterSet , user , outputFormat , configs ->
            re.reportExecution(false, report, user, parameterSet);
        },
        doVetoReportExecution : { report , parameterSet , user , outputFormat , configs -> }
] as ReportExecutionNotificationHook

In the report object received, report.getKey() always returns null. The report does have a key defined though (I see this for the Berichtsdokumentation report too, which also has a key).

I tried using parameterSet.getParameterMap() to get the "_RS_REPORT_KEY" ParameterValue, but this too had a null value.

Is this expected behaviour? I would like to do some processing in my hook based on the key value - is there another way to get the key if the above 2 methods are returning null by design?

Last edited by awilcox (2015-03-23 18:36:50)

Offline

#2 2015-03-23 19:37:19

Arno Mittelbach
datenwerke
Registered: 2012-02-14

Re: ReportExecutionNotificationHook - report key null in report parameter

From the top of my head .. try

report.getBaseReport()

which should give you a report object that has the key. As an explanation: ReportServer always creates a report variant which is then executed and the key is only stored on the base report.

Arno

Offline

#3 2015-03-23 20:04:02

awilcox
Member
Registered: 2015-03-02

Re: ReportExecutionNotificationHook - report key null in report parameter

Sorry, I can't seem to find a getBaseReport() method on Report.

Offline

#4 2015-03-23 20:07:47

Arno Mittelbach
datenwerke
Registered: 2012-02-14

Re: ReportExecutionNotificationHook - report key null in report parameter

The object that you should get there should implement the ReportVariant interface. For example BirtReportVariant.

Offline

#5 2015-03-23 20:20:59

awilcox
Member
Registered: 2015-03-02

Re: ReportExecutionNotificationHook - report key null in report parameter

Oh yes, got it now. Thanks very much!

Offline

#6 2019-04-17 13:57:17

Patryx
Member
Registered: 2019-03-25

Re: ReportExecutionNotificationHook - report key null in report parameter

Hi,
To sum up, I can't get report variant key from object report at all, can I?
report.getBaseReport.getKey() gives me a key of basic report.
report.getKey() doesn't give me key of variant report (the key name of variant report is filed in administration and I even use it in inline report).
Is there really no option to take key of variant report from object Report?

Last edited by Patryx (2019-04-18 06:08:55)

Offline

Board footer

Powered by FluxBB