|
Re: Where to put a function that is referenced in a dataset script [message #652382 is a reply to message #652294] |
Thu, 03 February 2011 17:23 |
|
Mike,
Try putting it in the initialize script for the report.
Jason
On 2/3/2011 8:55 AM, Mike Wulkan wrote:
> Hi,
>
> I have the following Javascript function:
>
>
> function fixBadDate(badDate) {
> importPackage(Packages.java.text);
> importPackage(Packages.java.util.date);
> if (badDate == null) {
> return null;
> }
> else {
> t = badDate.substr(1,badDate.length-2);
> sdf = new SimpleDateFormat("EEE MMM dd HH:mm:ss yyyy");
> return sdf.parse(t)
> }
> }
>
> which is used to cleanse some awkward data fields in the database. If I
> put this script directly in the computed columns expression everything
> works fine. However since I would like to use this function for several
> fields I would like to put it in a globally accessible place.
>
> I tried putting it in the "beforeopen" script for the dataset. When I do
> that the dataset preview results works just fine; indicating that the
> function can be found, however when I run the report the initial values
> of my report parameters based on this dataset are no longer filled in!
> My guess is that this is a timing issue and I just have to find a better
> place to put the function.
>
> Thanks
|
|
|
|
|
|
Re: Where to put a function that is referenced in a dataset script [message #652411 is a reply to message #652400] |
Thu, 03 February 2011 19:04 |
|
Mike,
Can you work up an example with the sample db so I can test it?
Jason
On 2/3/2011 1:27 PM, Mike Wulkan wrote:
> I understand the intent and this is what I tried originally; however it
> doesn't work. For some reason when I do this although the dataset
> preview works (which implies that the script is accessible), the
> parameter default values are not filled in.
|
|
|
Powered by
FUDForum. Page generated in 0.03966 seconds