Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 327850

Summary: Not able to access the session value using beforeOpen for birt:parameterPage query
Product: z_Archived Reporter: Sasikala <sasikala.chinnasamy>
Component: BIRTAssignee: Birt-Data-inbox <Birt-Data-inbox>
Status: REOPENED --- QA Contact: Maggie Shen <lshen>
Severity: critical    
Priority: P3 CC: bluesoldier, lchen
Version: unspecified   
Target Milestone: ---   
Hardware: PC   
OS: Windows XP   
Whiteboard:
Attachments:
Description Flags
jsp and report none

Description Sasikala CLA 2010-10-15 00:08:07 EDT
Build Identifier: 2.6.1 , 2.5.2, 2.3.2

I have to load  the first parameter of the cascade based on the session username value.

I have used <method name="beforeOpen"><![CDATA[var username;]]>var username =reportContext.getHttpServletRequest().getSession().getAttribute("username");</method>

and 

 <list-property name="parameters">
                 <structure>
                    <property name="name">param_1</property>
                    <property name="nativeName"></property>
                    <property name="dataType">string</property>
                    <property name="nativeDataType">12</property>
                    <property name="position">2</property>
                    <expression name="defaultValue">username</expression>
                    <property name="isInput">true</property>
                    <property name="isOutput">false</property>
                </structure>
			</list-property>

and 
<property name="queryText">
select c.country_name, s.state_name from country c, state s where s.country_id =c.country_id and username = ?	
</property>


But the value is not getting passed. Is there any way to pass the value

Reproducible: Always

Steps to Reproduce:
I have to load  the first parameter of the cascade based on the session username value.

I have used <method name="beforeOpen"><![CDATA[var username;]]>var username =reportContext.getHttpServletRequest().getSession().getAttribute("username");</method>

and 

 <list-property name="parameters">
                 <structure>
                    <property name="name">param_1</property>
                    <property name="nativeName"></property>
                    <property name="dataType">string</property>
                    <property name="nativeDataType">12</property>
                    <property name="position">2</property>
                    <expression name="defaultValue">username</expression>
                    <property name="isInput">true</property>
                    <property name="isOutput">false</property>
                </structure>
			</list-property>

and 
<property name="queryText">
select c.country_name, s.state_name from country c, state s where s.country_id =c.country_id and username = ?	
</property>


But the value is not getting passed. Is there any way to pass the value
Comment 1 Sasikala CLA 2010-10-16 03:15:31 EDT
Unable to access the session values in parameter page - cascade data set query
Comment 2 Liwen Chen CLA 2011-08-22 04:53:04 EDT
Created attachment 201899 [details]
jsp and report
Comment 3 Liwen Chen CLA 2011-08-22 04:55:35 EDT
Sasikala,

Please see attached files.
I get session attribute in report initialize method and use it in Dataset parameter.
It works.
I set this as Fixed, if you still think it has issue, please reopen this bug.

Thanks.
Comment 4 Xiaoying Gu CLA 2011-08-22 04:59:58 EDT
Set fixed, if still cannot work with the sample, please reopen it.
Comment 5 Xiaoying Gu CLA 2011-08-22 05:51:40 EDT
Reopen this issue.
Session attribute get in beforeOpen isn't available in Dataset Parameter panel, this is a bug.