|
Re: Global Script functions in a library [message #728205 is a reply to message #728031] |
Thu, 22 September 2011 17:54 |
|
Mike,
Why not just create a global.js file and put it in the resource folder.
In the report design add the global.js as a resource and the functions
in the global.js can then be used.
Jason
On 9/22/2011 8:30 AM, Mike Wulkan wrote:
> Hi,
>
> I'm looking for a way to put a collection of useful JavaScript functions
> in a library such that I can keep the source in one place and link the
> library object into my various reports. This way I can edit the
> functions in one place and automatically get the changes throughout my
> reports. However I haven't been able to find a place or element within a
> library where I can put a JavaScript function and be able to access it
> throughout my report.
>
> What is the best way to achieve this?
>
> Thanks,
> Mike
|
|
|
|
Re: Global Script functions in a library [message #730098 is a reply to message #730020] |
Tue, 27 September 2011 15:38 |
|
Mike,
You are correct. Can you open a bug to simplify this. There may be an
easier way, but the only one I know is: Where getMyValue is my function
in my global js.
icsc.getExternalContext().getScriptable().evaluate("getMyValue()")
Jason
On 9/27/2011 9:57 AM, Mike Wulkan wrote:
> This is working great. One question though, how do I reference a
> function from this file in a beforeGeneration chart script exit... it
> doesn't seem to find it directly and I can't find the magic incantation
> to provide the context?
|
|
|
|
Powered by
FUDForum. Page generated in 0.06501 seconds