Announcement

Migration of this forum

Dear users of this forum,

we are pleased to inform you that we will be updating the software behind this forum in the near future.

Existing posts, users and categories will remain untouched.

Important:

  • Each user will need to reset their password.
  • Please select "I forgot my password".
  • Enter the email address you used to register in this forum.
  • You will receive an email with a link to set a new password.
  • Please choose a new (secure) password and confirm the process.

We will keep you informed in the pinned thread.

Kind regards,
Your ReportServer Team


Migration des Forums

Liebe Nutzer dieses Forums,

wir freuen uns, euch mitteilen zu können, dass wir in naher Zukunft die Software hinter diesem Forum aktualisieren werden.

Existierende Beiträge, Nutzer und Kategorien bleiben weiterhin bestehen!

Wichtig:

  • Jeder Nutzer muss sein Passwort neu vergeben.
  • Wählt dazu einfach "Ich habe mein Passwort vergessen".
  • Gebt die E-Mail-Adresse ein, mit der ihr registriert seid.
  • Ihr erhaltet eine E-Mail mit einem Link zur Passwortvergabe.
  • Bitte wählt ein neues (sicheres) Passwort und bestätigt den Vorgang.

Wir halten euch im angepinnten Beitrag auf dem Laufenden!

Mit vielen Grüßen
Euer ReportServer Team

#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