Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 327850 - Not able to access the session value using beforeOpen for birt:parameterPage query
Summary: Not able to access the session value using beforeOpen for birt:parameterPage ...
Status: REOPENED
Alias: None
Product: z_Archived
Classification: Eclipse Foundation
Component: BIRT (show other bugs)
Version: unspecified   Edit
Hardware: PC Windows XP
: P3 critical (vote)
Target Milestone: ---   Edit
Assignee: Birt-Data-inbox@eclipse.org CLA
QA Contact: Maggie Shen CLA
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-10-15 00:08 EDT by Sasikala CLA
Modified: 2011-11-10 02:29 EST (History)
2 users (show)

See Also:


Attachments
jsp and report (3.49 KB, application/zip)
2011-08-22 04:53 EDT, Liwen Chen CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
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.