Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 324546 - external .js file has no effect in beforeOpen if the data set is used to generate a dynamic parameter selection
Summary: external .js file has no effect in beforeOpen if the data set is used to gene...
Status: RESOLVED FIXED
Alias: None
Product: z_Archived
Classification: Eclipse Foundation
Component: BIRT (show other bugs)
Version: unspecified   Edit
Hardware: PC Linux
: P3 normal (vote)
Target Milestone: 2.6.2   Edit
Assignee: Gang Liu CLA
QA Contact: Xiaoying Gu CLA
URL:
Whiteboard: Obsolete
Keywords:
Depends on:
Blocks:
 
Reported: 2010-09-06 02:47 EDT by Yap Sok Ann CLA
Modified: 2011-01-19 17:48 EST (History)
2 users (show)

See Also:


Attachments
sample report (15.70 KB, text/plain)
2010-09-06 02:49 EDT, Yap Sok Ann CLA
no flags Details
sample .js file (78 bytes, application/x-javascript)
2010-09-06 02:50 EDT, Yap Sok Ann CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Yap Sok Ann CLA 2010-09-06 02:47:57 EDT
Build Identifier: 

I define a function "replace_query" in an external .js file, and then include it in the report. I then use the function in the beforeOpen script. If the data set is not used to generate a dynamic parameter selection, then it works fine. Otherwise, when viewing the report, it will give this error:

Error evaluating Javascript expression. Script engine error: ReferenceError: "replace_query" is not defined.

Reproducible: Always

Steps to Reproduce:
1. Define a function in an external .js file
2. Include the .js file in the report
3. Call the function in the beforeOpen script of a data set that is also used to generate a dynamic parameter selection
Comment 1 Yap Sok Ann CLA 2010-09-06 02:49:41 EDT
Created attachment 178236 [details]
sample report
Comment 2 Yap Sok Ann CLA 2010-09-06 02:50:08 EDT
Created attachment 178237 [details]
sample .js file
Comment 3 Xiaoying Gu CLA 2010-09-06 05:27:18 EDT
(In reply to comment #2)
> Created an attachment (id=178237) [details]
> sample .js file

Which BIRT version were you using?

I can not reproduce this issue on BIRT 2.6.0 release, using the attached report and js file.
Dynamic parameter list pops up with customer names.
Comment 4 Yap Sok Ann CLA 2010-09-06 05:41:19 EDT
You are not supposed to see any customer name, because the beforeOpen script should have replaced "1 = 1" with "1 = 0"
Comment 5 Xiaoying Gu CLA 2010-09-06 06:02:08 EDT
(In reply to comment #4)
> You are not supposed to see any customer name, because the beforeOpen script
> should have replaced "1 = 1" with "1 = 0"

Which BIRT version were you using to reproduce this issue?
Comment 6 Yap Sok Ann CLA 2010-09-06 06:04:17 EDT
I am using version 2.5.2 here.
Comment 7 Wenfeng Li CLA 2011-01-19 17:48:35 EST
(In reply to comment #6)
> I am using version 2.5.2 here.

Can you try 2.6.1 to see if the issue still exists?  If yes, please reopen the bug.