Anyway, so what I needed was to set a property in the report context that could be accessed withing a chart event. Now, if I was using the Javascript handler, something like the following would be sufficient:
context.getExternalContext().getScriptable()
However, this does not return anything close to a context in a Java event handler. The
context.getExternalContext() returns a BIRTExternalContext object, this is not a public accessible class. And getScriptable
returns a NativeJavaObject. So, in a way that is not documented anywhere, you can do the
following to get access to an IReportContext object from within a Java Event handler for charts:
Object o = icsc.getExternalContext().getObject();
IReportContext context = (IReportContext)o;
Thats it. Not sure why this is not documented anywhere since it seems to be asked a bunch.
1 comment:
This was exactly what I was looking for. Thanks!
Post a Comment