Script for chart [message #150119] |
Sat, 01 April 2006 15:53 ![Go to next message Go to next message](theme/Solstice/images/down.png) |
Eclipse User![Friend of Eclipse Friend](/donate/web-api/friends_decorator.php?email=) |
|
|
|
Originally posted by: pkustack.gmail.com
Birt examples show that there are some callback script function that we can
use to decorate the charts:
function beforeDrawDataPoint( dph, fill, context ){}
function beforeDrawDataPointLabel( dph, label, context ){}
...
What i want to do is access report parameters in these script functions.
For example:
function beforeDrawSeriesTitle(series, label, scriptContext)
{
label.getCaption().setValue(params["title"]);
}
But it seems that this is not working.
I've tried to access reportContext by scriptContext(I don't konw if it is
possible),but still not working.
Could you tell me if it is possible to access report parameter here and if
it is not possible,is there any other way to do reach the parameters?
Thank you very much!
|
|
|
Re: Script for chart [message #150415 is a reply to message #150119] |
Mon, 03 April 2006 17:46 ![Go to previous message Go to previous message](theme/Solstice/images/up.png) |
David Michonneau![Friend of Eclipse Friend](/donate/web-api/friends_decorator.php?email=dmichonneau%40actuate.com) Messages: 1145 Registered: July 2009 |
Senior Member |
|
|
You can access them through the scriptcontext:
scriptContext.getExternalContext().getScriptable() will give you access to a
IReportContext object, where you can access report parameters. I advise
writing scripts in Java as it is easier to debug than JavaScript.
Thanks,
David
"lihe" <pkustack@gmail.com> wrote in message
news:e0m7m1$953$1@utils.eclipse.org...
> Birt examples show that there are some callback script function that we
> can use to decorate the charts:
> function beforeDrawDataPoint( dph, fill, context ){}
> function beforeDrawDataPointLabel( dph, label, context ){}
> ...
> What i want to do is access report parameters in these script functions.
> For example:
> function beforeDrawSeriesTitle(series, label, scriptContext)
> {
> label.getCaption().setValue(params["title"]);
> }
> But it seems that this is not working.
> I've tried to access reportContext by scriptContext(I don't konw if it is
> possible),but still not working.
> Could you tell me if it is possible to access report parameter here and if
> it is not possible,is there any other way to do reach the parameters?
> Thank you very much!
>
|
|
|
Powered by
FUDForum. Page generated in 0.03276 seconds