How to default bind variable using session variable at run time

Hi All,
I have a requirement where all VO queries (multiple VOs) produce only records that meet a certain value.
For example, I have three tables with 3 VOs and each of them has a one-to-many relationship to another table (let's call it ref table and this table has a field called release). One of the 3 VOs is a parent/master table, and the other two are child tables. I created a VO for master table that linked to the ref table and created a view criteria using the release (use bind variable) field from the ref table. The other child tables have their own VO that has view criteria that also linked to ref table using the release field.
On the UI page, I created a query component and a table from the master table VO. I also dropped the child table VOs in a tabbed panel which partial triggered by the master table. When I ran a query for a 'release' (hint: ref table value), the table for master table was filled the correct records that meet the criteria. Unfortunately, the child tables were not correct due to the query didn't use the bind variable that filter only records for the same 'release' value as the master table.
The question is how do I 'default' or dynamically set the bind variable on the child tables based on the selection criteria from the query component. I am thinking to set a session variable from the query and use it in the bind variable in the child table, but not sure how to do it.
Any suggestion how to do it or better solution to achieve the same effect?

Hi,
How about creating a custom AMImpl method, that takes parameters as required, and set the bind variables for all the desired VOs and perform executeQuery on them.
You could expose this as client interface, and then use the method as parameter form.
Check this thread for ex.
Re: Setting Attribute in View Object through Managed Bean
-Arun

Similar Messages

  • Setting VO bind variable using session variable

    Hi,
    I need to get/set VO bind variable using ApplicationModuleImple or ViewObjectImple class. Does Any one know how to do it?
    I have one VO based on query like "select name from users where password = :password ". I had a bind variable to it too. now i want to set it from a session scoped variable. can i do it using ADFContext.getCurrent().getSession().get('username'); ? but somehow I am not able to get the knowledge i.e where to set bind variable. please help.

    Timo thanks for the reply, actually I don't want to do it using data control i.e drag and drop method to a page. Instead i just want to set bind variable to a session varable already got from login page.
    I got the following sollotion but don't know where to put them,
    1.
    FacesContext context = FacesContext.getCurrentInstance();
    ValueBinding vb = context.getApplication().createValueBinding("#{data}");
    BindingContext bci = (BindingContext)vb.getValue(context);
    DCDataControl dc = bci.findDataControl("AppModuleDataControl");
    ApplicationModule am = (ApplicationModule)dc.getDataProvider();
    AppModuleImpl service = (AppModuleImpl)am;
    ViewObject vo = service.findViewObject("YourViewObject").setNamedWhereClauseParam("nameBindVariable", objectValue);
    vo.executeQuery();
    what is the #{data} in second line ? if you know please let me know.
    Second Solution :
    2- In backing bean code:
    FacesContext context = FacesContext.getCurrentInstance();
    Application fapp = context.getApplication();
    JUFormBinding adfbc = (JUFormBinding)fapp.createValueBinding("#{bindings}").getValue(context);
    DCIteratorBinding iter = adfbc.findIteratorBinding("YourIterator");
    iter.getViewObject().setNamedWhereClauseParam("nameBindVariable", objectValue);
    iter.executeQuery();
    where would I get "YourIterator" ... ? I am still a new at jdev ... ;)

  • How do i filter recordsets using session variable???  Please help this is driving me mad...!!

    I am having the same problem as user "Gabe the animator" in a post sent in 2007.
    "my recordset that drives a dynamic table won't filter results based on a session variable. I know session variables are working because I have the session variable echo on the page (dragged-n-dropped my session variable from the Bindings panel to my page), and that works fine. So why can't I filter my recordset with the same session variable???"
    here is the code:
    <?php require_once('Connections/mockconn.php'); ?>
    <?php
    session_start();
    ?>
    <?php
    if (!function_exists("GetSQLValueString")) {
    function GetSQLValueString($theValue, $theType, $theDefinedValue = "", $theNotDefinedValue = "")
      if (PHP_VERSION < 6) {
        $theValue = get_magic_quotes_gpc() ? stripslashes($theValue) : $theValue;
      $theValue = function_exists("mysql_real_escape_string") ? mysql_real_escape_string($theValue) : mysql_escape_string($theValue);
      switch ($theType) {
        case "text":
          $theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
          break;   
        case "long":
        case "int":
          $theValue = ($theValue != "") ? intval($theValue) : "NULL";
          break;
        case "double":
          $theValue = ($theValue != "") ? doubleval($theValue) : "NULL";
          break;
        case "date":
          $theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
          break;
        case "defined":
          $theValue = ($theValue != "") ? $theDefinedValue : $theNotDefinedValue;
          break;
      return $theValue;
    if(!session_id()){
    session_start();
    $colname_info = "-1";
    if (isset($_SESSION['email'])) {
      $colname_info = $_SESSION['email'];
    mysql_select_db($database_mockconn, $mockconn);
    $query_info = sprintf("SELECT name, last_name, email, password FROM registration WHERE email = %s", GetSQLValueString($colname_info, "text"));
    $info = mysql_query($query_info, $mockconn) or die(mysql_error());
    $row_info = mysql_fetch_assoc($info);
    $totalRows_info = mysql_num_rows($info);
    ?>
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>home</title>
    </head>
    <body>
    <div id="info">hello <?php echo $row_info['']; ?></div>
    <?php
    if (isset($_SESSION['email'])) {
              echo 'your email: '.' '. $_SESSION['email'] .' '.'good job';}
                        ?>
    </body>
    </html>
    PLEASE PLEASE HELP.... I have been at this for day's...
    how do I get the record set to filter based on the value of the session variable

    Sorry I forgot to mension the error I am getting?
    ( ! ) Notice: Undefined index: in C:\wamp\www\mock\home.php on line 59
    Call Stack
    Time
    Memory
    Function
    Location
    1
    0.0093
    389024
    {main}( )
    ..\home.php:0
    Why is this error coming up?

  • How to set proxy authentication using java properties at run time

    Hi All,
    How to set proxy authentication using java properties on the command line, or in Netbeans (Project => Properties
    => Run => Arguments). Below is a simple URL data extract program which works in absence of firewall:
    import java.io.*;
    import java.net.*;
    public class DnldURLWithoutUsingProxy {
       public static void main (String[] args) {
          URL u;
          InputStream is = null;
          DataInputStream dis;
          String s;
          try {
              u = new URL("http://www.yahoo.com.au/index.html");
             is = u.openStream();         // throws an IOException
             dis = new DataInputStream(new BufferedInputStream(is));
             BufferedReader br = new BufferedReader(new InputStreamReader(dis));
          String strLine;
          //Read File Line By Line
          while ((strLine = br.readLine()) != null)      {
          // Print the content on the console
              System.out.println (strLine);
          //Close the input stream
          dis.close();
          } catch (MalformedURLException mue) {
             System.out.println("Ouch - a MalformedURLException happened.");
             mue.printStackTrace();
             System.exit(1);
          } catch (IOException ioe) {
             System.out.println("Oops- an IOException happened.");
             ioe.printStackTrace();
             System.exit(1);
          } finally {
             try {
                is.close();
             } catch (IOException ioe) {
    }However, it generated the following message when run behind the firewall:
    cd C:\Documents and Settings\abc\DnldURL\build\classes
    java -cp . DnldURLWithoutUsingProxy
    Oops- an IOException happened.
    java.net.ConnectException: Connection refused
    at java.net.PlainSocketImpl.socketConnect(Native Method)
    at java.net.PlainSocketImpl.doConnect(PlainSocketImpl.java:305)
    at java.net.PlainSocketImpl.connectToAddress(PlainSocketImpl.java:171)
    at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:158)
    at java.net.Socket.connect(Socket.java:452)
    at java.net.Socket.connect(Socket.java:402)
    at sun.net.NetworkClient.doConnect(NetworkClient.java:139)
    at sun.net.www.http.HttpClient.openServer(HttpClient.java:402)
    at sun.net.www.http.HttpClient.openServer(HttpClient.java:618)
    at sun.net.www.http.HttpClient.<init>(HttpClient.java:306)
    at sun.net.www.http.HttpClient.<init>(HttpClient.java:267)
    at sun.net.www.http.HttpClient.New(HttpClient.java:339)
    at sun.net.www.http.HttpClient.New(HttpClient.java:320)
    at sun.net.www.http.HttpClient.New(HttpClient.java:315)
    at sun.net.www.protocol.http.HttpURLConnection.plainConnect(HttpURLConnection.java:510)
    at sun.net.www.protocol.http.HttpURLConnection.connect(HttpURLConnection.java:487)
    at sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:615) at java.net.URL.openStream(URL.java:913) at DnldURLWithoutUsingProxy.main(DnldURLWithoutUsingProxy.java:17)
    I have also tried the command without much luck either:
    java -cp . -Dhttp.proxyHost=wwwproxy -Dhttp.proxyPort=80 DnldURLWithoutUsingProxy
    Oops- an IOException happened.
    java.io.IOException: Server returned HTTP response code: 407 for URL: http://www.yahoo.com.au/index.html
    at sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:1245) at java.net.URL.openStream(URL.java:1009) at DnldURLWithoutUsingProxy.main(DnldURLWithoutUsingProxy.java:17)
    All outgoing traffic needs to use the proxy wwwproxy (alias to http://proxypac/proxy.pac) on port 80, where it will prompt for valid authentication before allowing to get through.
    There is no problem pinging www.yahoo.com from this system.
    I am running jdk1.6.0_03, Netbeans 6.0 on Windows XP platform.
    I have tried Greg Sporar's Blog on setting the JVM option in Sun Java System Application Server (GlassFish) and
    Java Control Panel - Use browser settings without success.
    Thanks,
    George

    Hi All,
    How to set proxy authentication using java properties on the command line, or in Netbeans (Project => Properties
    => Run => Arguments). Below is a simple URL data extract program which works in absence of firewall:
    import java.io.*;
    import java.net.*;
    public class DnldURLWithoutUsingProxy {
       public static void main (String[] args) {
          URL u;
          InputStream is = null;
          DataInputStream dis;
          String s;
          try {
              u = new URL("http://www.yahoo.com.au/index.html");
             is = u.openStream();         // throws an IOException
             dis = new DataInputStream(new BufferedInputStream(is));
             BufferedReader br = new BufferedReader(new InputStreamReader(dis));
          String strLine;
          //Read File Line By Line
          while ((strLine = br.readLine()) != null)      {
          // Print the content on the console
              System.out.println (strLine);
          //Close the input stream
          dis.close();
          } catch (MalformedURLException mue) {
             System.out.println("Ouch - a MalformedURLException happened.");
             mue.printStackTrace();
             System.exit(1);
          } catch (IOException ioe) {
             System.out.println("Oops- an IOException happened.");
             ioe.printStackTrace();
             System.exit(1);
          } finally {
             try {
                is.close();
             } catch (IOException ioe) {
    }However, it generated the following message when run behind the firewall:
    cd C:\Documents and Settings\abc\DnldURL\build\classes
    java -cp . DnldURLWithoutUsingProxy
    Oops- an IOException happened.
    java.net.ConnectException: Connection refused
    at java.net.PlainSocketImpl.socketConnect(Native Method)
    at java.net.PlainSocketImpl.doConnect(PlainSocketImpl.java:305)
    at java.net.PlainSocketImpl.connectToAddress(PlainSocketImpl.java:171)
    at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:158)
    at java.net.Socket.connect(Socket.java:452)
    at java.net.Socket.connect(Socket.java:402)
    at sun.net.NetworkClient.doConnect(NetworkClient.java:139)
    at sun.net.www.http.HttpClient.openServer(HttpClient.java:402)
    at sun.net.www.http.HttpClient.openServer(HttpClient.java:618)
    at sun.net.www.http.HttpClient.<init>(HttpClient.java:306)
    at sun.net.www.http.HttpClient.<init>(HttpClient.java:267)
    at sun.net.www.http.HttpClient.New(HttpClient.java:339)
    at sun.net.www.http.HttpClient.New(HttpClient.java:320)
    at sun.net.www.http.HttpClient.New(HttpClient.java:315)
    at sun.net.www.protocol.http.HttpURLConnection.plainConnect(HttpURLConnection.java:510)
    at sun.net.www.protocol.http.HttpURLConnection.connect(HttpURLConnection.java:487)
    at sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:615) at java.net.URL.openStream(URL.java:913) at DnldURLWithoutUsingProxy.main(DnldURLWithoutUsingProxy.java:17)
    I have also tried the command without much luck either:
    java -cp . -Dhttp.proxyHost=wwwproxy -Dhttp.proxyPort=80 DnldURLWithoutUsingProxy
    Oops- an IOException happened.
    java.io.IOException: Server returned HTTP response code: 407 for URL: http://www.yahoo.com.au/index.html
    at sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:1245) at java.net.URL.openStream(URL.java:1009) at DnldURLWithoutUsingProxy.main(DnldURLWithoutUsingProxy.java:17)
    All outgoing traffic needs to use the proxy wwwproxy (alias to http://proxypac/proxy.pac) on port 80, where it will prompt for valid authentication before allowing to get through.
    There is no problem pinging www.yahoo.com from this system.
    I am running jdk1.6.0_03, Netbeans 6.0 on Windows XP platform.
    I have tried Greg Sporar's Blog on setting the JVM option in Sun Java System Application Server (GlassFish) and
    Java Control Panel - Use browser settings without success.
    Thanks,
    George

  • How can we use Session Variable in Answers or Analysis?

    How can we use Session Variable in Answers or Analysis?

    Again, duplicate cross-posting!
    See rukbat 's post here: Re: BI Apps 7.9.6.3(Agent Issue)

  • How to set MULTIPLE repository variables using presentation variables

    Hi,
    I need to pass multiple values from presentation variable to repository.
    A brief about report design :
    I have two repository variables - from_dt and to_dt which are defaulted to some values from a database table and are editable by the user.
    I display these default date values on the dashboard. Plus there are two dashboard date prompts allowing user to enter a date range different from what is displayed by the from_dt and to_dt. The dates entered by user are assigned to presentation variables pv_from_dt and pv_to_dt.
    If user specifies a different date range then these date values are to be passed to a stored procedure which is called from the Connection Pool --> Connection Script Tab --> Execute before query. This procedure will do some calculations and populate a global temporary table before running the report.
    Problem :
    Now in the presentation server, in the Advanced tab, in the Prefix section, when i try to write something like this:
    SET VARIABLE from_dt = '@{pv_from_dt}';
    SET VARIABLE to_dt = '@{pv_to_dt}';
    I get the foll error :-
    Error Codes: YQCO4T56:OPR4ONWY:U9IM8TAC:OI2DL65P
    Odbc driver returned an error (SQLExecDirectW).
    State: HY000. Code: 10058. [NQODBC] [SQL_STATE: HY000] [nQSError: 10058] A general error has occurred. [nQSError: 27002] Near <SET>: Syntax error [nQSError: 26012] . (HY000)
    I tried all possible permutations and combinations
    SET VARIABLE from_dt = '@{pv_from_dt}',SET VARIABLE to_dt = '@{pv_to_dt}'; --- gave same error
    SET VARIABLE from_dt = '@{pv_from_dt}' SET VARIABLE to_dt = '@{pv_to_dt}'; -- gave same error
    How do we assign values to multiple reporsitory variables... ???
    Thanks
    Nusrat

    Hi,
    I wrongly referred to the variables as "repository" variables. Both variables are Session variables. For testing i added a column field in the report with source as the session variable - VALUEOF(NQ_SESSION.from_dt). In the Prefix section i assigned a literal value - SET VARIABLE from_dt='01-JAN-2012';
    When report is run, the literal value gets displayed.
    The idea to update a session variable, from dashboard using presentation variable, i got from the following URL.
    Go to http://oraclebizint.wordpress.com/category/obi-ee-plus/page/11/
    and see the section "Oracle BI EE 10.1.3.3/2 – Updating Session Variables from Dashboards using Presentation Variables"
    Thanks
    Nusrat
    Edited by: user10309945 on Jan 16, 2011 9:30 PM
    Edited by: user10309945 on Jan 16, 2011 9:59 PM

  • Use session variable in Insert record

    Help, please!
    I need to add a record to a table; one of the fields in the
    table is the user_id. When I try to use the insert record server
    behavior, there is no way to select the user_id session variable!
    How is this done?

    .oO(Ted Dawson)
    >>>> to select the user_id session variable! How
    is this done?
    >>>
    >>>Use a hidden variable in the form, and assign it
    the value of the session.
    >>
    >> And what if the user manipulates that value? Hidden
    form fields _always_
    >> require a validation on the server. One purpose of a
    session is to avoid
    >> that sensitive data is sent to the client, where it
    can be manipulated.
    >
    >
    >Exactly how is the value of a SESSION VARIABLE
    manipulated by the client?
    It can be manipulated if it's put into a hidden form field.
    Micha

  • Dates Format in Promts using Session Variables

    Hi Experts,
    I have an issue in controlling date format in prompts using session variable which I am using to set default value.
    By default date format is timestamp E.g '2010-12-19 12:00:00 AM'.
    As per requriement(s) I customized the date format in Reports as 19-Dec-2010 and I saved it as "System Wide Default for <Date Column Name> "
    So, I got desired format in Reports and Date Prompts.
    Now, I need to set a default value in Date Prompt. So, in RPD I created a Session Variable which returned me date in
    DD-MON-YYYY format. Using follwing SQL :
    SELECT REPLACE(CONVERT(VARCHAR(11), Getdate (), 106), ' ', '-') AS [DD-Mon-YYYY]
    But in reports takes this value as string and not Datetime. So i got an error message.
    A datetime value was expected (received "19-Dec-2010").
    If i do not use above SQL to CONVERT date then default date in prompt get displayed as timestamp format and give me desired results but Formatting looks very odd in prompt
    Is this a way so I can persist the [DD-Mon-YYYY] Formatting for default value which comes using variable and still run the report.
    Above problem also exist vice versa that is if i SET that session variable and pass the datetime value to server. But there i guess I can use ToDate or some Casting in RPD column expression to handle that. Tell me if i am right ?
    Thanks
    Saurabh

    That almost works. I had to adjust the syntax to the following...and then there are other issues doing this.
    select cust_no, name,'@{session.currentUser}' from customersMy write-back SQL is this:
    UPDATE customers SET NAME='@{c1}',LAST_EDITED_BY='@{c2}' WHERE CUST_NO=@{c0}But I don't want to display the cust_no column to the user. So I hide it in the UI. But if I do that I get the below error during write-back. Apparently sometimes when you hide a column on a direct query (numeric maybe?) the value doesn't transfer over to the write-back. If that's the case, this won't work for me. Hmm...
    Error Codes: OPR4ONWY:U9IM8TAC:OI2DL65P
    State: HY000. Code: 10058. [NQODBC] [SQL_STATE: HY000] [nQSError: 10058] A general error has occurred. [nQSError: 43093] An error occurred while processing the EXECUTE PHYSICAL statement. [nQSError: 17001] Oracle Error code: 936, message: ORA-00936: missing expression at OCI call OCIStmtExecute: UPDATE customers SET NAME='Wyatt Donnely',LAST_EDITED_BY='Administrator' WHERE CUST_NO= . [nQSError: 17011] SQL statement execution failed. (HY000)
    SQL Issued: EXECUTE PHYSICAL CONNECTION POOL dev1 UPDATE customers SET NAME='Wyatt Donnely',LAST_EDITED_BY='Administrator' WHERE CUST_NO=

  • Alternate method to writing filter for recordset using session variable

    I'm not sure if this can be done.  I have a user page which I'd like to return database info based upon a userid entered on another page. So far, the session variable (userid) is captured on the user page however it is supposed to return the user's name rather than displaying the session variable.
    My problem is this. Within dreamweaver, I am able to create recordsets however I cannot create a filter. The connection works. At this point, I am searching for a workaround where I can tie in the session variable to recordsets. I should make mention that whenever I update the sql statement using the recordset widget, my recordset disappears. ?  At any rate, heres a sample of the code sans connection strings, etc.
    <%
    Dim Recordset1
    Dim Recordset1_cmd
    Dim Recordset1_numRows
    Set Recordset1_cmd = Server.CreateObject ("ADODB.Command")
    Recordset1_cmd.ActiveConnection = MM_newuniversity1_STRING
    Recordset1_cmd.CommandText = "SELECT name FROM table WHERE userid =  '" & Session("userid_my") & "'"
    Recordset1_cmd.Prepared = true
    Set Recordset1 = Recordset1_cmd.Execute
    Recordset1_numRows = 0
    %>
    On the user page, I have a 'Welcome' and the following code
    {Request.userid_my}
    Any suggestions? I'm afraid I'm a newbie to asp within dreamweaver cs3.

    >When I insert  request.userid_my code it returns the session variable
    AFAIK, session variables are not part of the request object - so I do not understand why you are referencing them this way. I would use the standard reference method : Welcome <%Response.Write(Session("username"))%>
    >when I insert the recordset associated with 'name' I get an Adobe End of file error. ?
    Sounds like a possible problem with your installation. You may need to try reinstalling DW. How are you "inserting" this recordset and when does the error occur?
    Regarding your next post...
    >select name from table_name where userid = '" & namemy & "'"
    >The statement consistently returns a 'quoted string not properly terminated' error.....
    The select statement you quoted is obviously not complete. If you are refering to the select in your OP:
    Recordset1_cmd.CommandText = "SELECT name FROM table WHERE userid =  '" & Session("userid_my") & "'"
    I see nothing wrong with that syntax and the string appears to be terminated correctly. If there is a different statement causing the error, please post the entire line and include a line above and below.

  • Can we use session variables in BI publisher's Data Model SQL Query?

    Hi Experts,
    We need to implement Data level security in BI Publisher 11g.
    In OBIEE we do so by using session variables, so just wanted to ask if we can use the same session variables in BI Publisher as well
    ie can we include the where clause in the Data Models SQL Query like
    Where ORG_ID = @{biServer.variables['NQ_SESSION.INV_ORG']}
    Let me know your views on this.
    PS: We are implementing EBS r12 security in BI Publisher.
    Thanks

    Read this -> OBIEE 11g: Error: "[nQSError: 23006] The session variable, NQ_SESSION.LAN_INT, has no value definition." when Creating a SQL Query using the session variable NQ_SESSION.LAN_INT in BI Publisher [ID 1511676.1]
    Follow the ER - BUG:13607750 - NEED TO BE ABLE TO SET A SESSION VARIABLE IN OBIEE AND USE IT IN BI PUBLISHER
    HTH,
    SVS

  • Use Session Variable with row-wise initialization

    Hello,
    I use an initialization block in order to load some translations in my repository (version is 11.1.1.6.BP1) :
    SQL :
    SELECT CODE_KEY, STRING_VALUE FROM "TABLES" WHERE  LANGUAGE_KEY= 'VALUEOF(NQ_SESSION.USERLOCALE)'
    Values :
    CN_INCOMING, Incoming, en
    CN_OUTGOING, Outgoing, en
    CN_INCOMING, Réception, fr
    CN_OUTGOING, Emission, fr
    etc ...
    I checked the row-wise intialization.
    The query is correct and returns the right values (I check in the log file ..).
    So far, So good.
    But when I want to use session variables in a column expression (in repository) like  :
    CASE WHEN "column"="xx" THEN VALUEOF(NQ_SESSION."CN_INCOMING")  ELSE VALUEOF(NQ_SESSION."CN_OUTGOING") END
    I got the error: [nQSError: 23006] The session variable, NQ_SESSION.CN_OUTGOING, has no value definition.
    If I used the same formula directly in Answers it's working correctly.
    Do I have to necessarily do this in answers or is there a way to do this in the repository.
    Thanks in advance
    Regards
    Benjamin

    Yes I already tested this point, when I don't use a row wise initialization it's working, but I don't want to create one variable for each translations that I need to use in column formula if you know what I mean.
    I don't understand why we can't use this kind of variable in this context ..but if I have to create the column in my analysis, I will do that, but it's not really user friendly
    Anyway thanks for your time.

  • Page Specific Persistence using Session Variables

    Hi, I have read a lot about using session variables to persist the ReportDocument object across page loads.  This works fine if you have just one page open with one report.  The problem I am having is I have a web application that makes 30 or 40 different reports available to the user.  To simplify the code and make it easier to add new reports I have developed a single template aspx page that can be used to view any of the reports.
    My problem is that if the user opens 2 different reports in 2 separate tabs in the browser then the session variable persistence doesn't work because the session variable is available to both tabs.
    Is there a way to persist the ReportDocument object which is 'page' specific.
    Thanks

    Your best option is likely to have something that makes the session variable names unique.  I've done such things as putting the current datetime in the url as a querystring parameter and appending that to the variable name.  On each postback that querystring should persist.
    You might be able to use the reportclientdocument object and serialize the report and persist through view state, haven't tried this with inproc ras though.  A sample that uses the ras sdk can be found [here|http://wiki.sdn.sap.com/wiki/display/BOBJ/NETRASSDK+Samples]

  • Session variable using :GROUP variable in init block

    I'd like to filter using session variable.
    This session variaible should be build using :GROUP special session variable
    I'd like do something like this (init block):
    select  case when instr(upper(':GROUP'), 'ADMINISTRATOR')>0 then 'Yes' else 'No' end from dual
    but it seems to doesn't work properly (It means I have always 'No' value)
    After investigation i did some simple test
    initialization block like this:
    select  upper(':USER'),upper(':GROUP') from dual
    set variables using above init block: UPP_USER and UPP_GROUP
    next i did simple reques with 4 columns:
    *1. VALUEOF(NQ_SESSION.USER)*
    *2. VALUEOF(NQ_SESSION.GROUP)*
    *3. VALUEOF(NQ_SESSION.UPP_USER)*
    *4. VALUEOF(NQ_SESSION.UPP_GROUP)*
    and my result is:
    1. Administrator
    2. Administrators;IT_Deparment ....
    3. ADMINISTRATOR
    4. _:GROUP_
    Why in 4th column I didn't get: ADMINISTRATOR;IT_DEPARTMENTS ....
    Can I use special variable GROUP in initialization block?
    Could someone explain it?

    Hi,
    Only :USER and :PASSWORD are available
    try (select 'VALUEOF(NQ_SESSION.USER)', 'VALUEOF(NQ_SESSION.GROUP)' from dual instead.
    (You migth have to force a fill of the group variable first)
    Regards
    John
    http://obiee101.blogspot.com/

  • Sticky using session variables

    Hello
    I was wondering if it is possible to stick a session to a server using session variables (such as username) Currently I am using cookies to keep the session sticky but i also need to use the session variables.
    Thanks
    Donagh

    Donagh,
    there is absolutely no reason to use both.
    If the name is more important, than use the name.
    If the cookie is more important, than use the cookie.
    If one is not more important than the other, then keep using the cookie.
    Another way to see it is :
    if the name and the cookie refer to the same server, it does not matter which one you use.
    But if they point to different servers.
    What do you do ?
    Which information do you use to select the server ?
    The name or the cookie ?
    As I said, there is no reason to use both.
    Unless if one is missing.
    But the problem is then to make sure it is always there.
    Is there any stickyness issue currently ?
    Gilles.

  • Trying to move a list of form variables to session variables of the same name

    I am trying to move a list of form variables to session variables of the same name and I am having a lot of trouble.
    I have never had to post of this forum with a language question in all the 10 years I have been using ColdFusion. I was a qa Engineer @ Allaire/Macromedia back when it was going from one to the other. I have a pretty good grasp of the language.
    I have software that runs off a list. The fieldnames are variable and stored off in an array. It's survey software that runs off a "meta file". In this example; I have the number of fields in the survey set to 12 in the "metafile". I have each field declared in that file in array Session.SurveyField[1] and the above loop works fine. I include this "metafile" at the start of the process.
    I cfloop around a struct and it works wherever I have needed to use it; such as here - writing to the database for example;
    <CFQUERY NAME="InsertRec" DATASOURCE="Survey">
    INSERT into #variables.SurveyTableName#
    (EntryTime
    <cfloop from="1" to="#Session.NumberOfSurveyFields#" index="arrayindex">
    ,#Session.SurveyField[arrayindex]#
    </cfloop>
    <!--- EXAMPLE OF WHAT THE ABOVE GENERATES
    ,q01_name,q02_AcadTechORNA,q03_Water,q04_FirstAid,q05_CPR,q06_LifeGuard,q07_AED
    ,q08_ProjAdv,q09_Color,q10_SantaClaus,q11_Supervisor,q12_SupervisorOpinion --->
       VALUES
        ('#EntryTime#'
    <cfloop from="1" to="#Session.NumberOfSurveyFields#" index="arrayindex">
    <cfset thisname = "Session." & Session.SurveyField[arrayindex]>
    ,'#evaluate(variables.thisname)#'
    </cfloop>
    <!--- EXAMPLE OF WHAT THE ABOVE GENERATES
    ,'#Session.q01_name#','#Session.q02_AcadTechORNA#','#Session.q03_Water#','#Session.q04_Fi rstAid#'
    ,'#Session.q05_CPR#','#Session.q06_LifeGuard#','#Session.q07_AED#','#Session.q08_ProjAdv# ',
    ,'#Session.q09_Color#','#Session.q10_SantaClaus#','#Session.q11_Supervisor#','#Session.q1 2_SupervisorOpinion#' --->
    </CFQUERY>
    NOW HERE'S THE PROBLEM: I am running into trouble when trying to move the form variables to session variables of the same name. It is the only part of the software that I still need the datanames hard coded and that is a roadblock for me.
    <cfloop from="1" to="#Session.NumberOfSurveyFields#" index="arrayindex">
    <cfset thissessionfield = "Session." & Session.SurveyField[arrayindex]>
    <cfset thisformfield = "Form." & Session.SurveyField[arrayindex]>
    <cfset #thissessionfield# = #evaluate(thisformfield)#>
    </cfloop>
    I have tried it with or without the "evaluate"; same result. It doesn't give an error; it just ignores them (session variables look as such in the next page in the chain)
    q01_name=
    q02_acadtechorna=
    q03_water=
    q04_firstaid=
    q05_cpr=
    q06_lifeguard=
    q07_aed=
    q08_projadv=
    q09_color=
    q10_santaclaus=
    q11_supervisor=
    q12_supervisoropinion=
    Note: they exist because I CFPARAM them in a loop like the above at the start of the procedure) - and this works just fine!
    <cflock scope="Session" type="EXCLUSIVE" timeout="30">
    <cfloop from="1" to="#Session.NumberOfSurveyFields#" index="arrayindex">
    <cfset dataname = "Session." & Session.SurveyField[arrayindex]>
    <cfparam name="#variables.dataname#" default="">
    </cfloop>
    </cflock>
    I EVEN tried exploiting the Form.Fieldnames list using CFLoop over the list and the same sort of logic within and it still gives me nothing....
    Here's the FORM.FIELDNAMES value
    "Q01_NAME,Q02_ACADTECHORNA,Q03_WATER,Q04_FIRSTAID,Q05_CPR,Q06_LIFEGUARD,Q07_AED,Q08_PROJAD V,Q09_COLOR,
    Q10_SANTACLAUS,Q11_SUPERVISOR,Q12_SUPERVISOROPINION"
    Here's the logic; SAME RESULT - The session variables don't get set.
    <cfoutput>
    <cfloop list="#Form.FieldNames#" index="thisfield">
    <!--- <br>#thisfield# --->
    <cfscript>
    thisSESSIONfield = "Session." & thisfield;
    thisFORMfield = "Form." & thisfield;
    #thisSESSIONfield# = #thisFORMfield#;
    </cfscript>
    </cfloop>
    </cfoutput>
    The CFPARAM in a loop with variable output name works just fine; so does the post (which I included above) as does the SQL Create, Param Form Variables, Param Session Variables, etc.
    THIS even works for moving BLANK to each session variable, to zero them all out at the end of the process;
    <cflock scope="Session" type="EXCLUSIVE" timeout="30">
    <cfloop from="1" to="#Session.NumberOfSurveyFields#" index="arrayindex">
    <cfset thislocalfield = Session.SurveyField[arrayindex]>
    <cfscript>
    thissessionfield = "Session." & thislocalfield;
    </cfscript>
    <cfset #thissessionfield# = "">
    </cfloop>
    </cflock>
    Expanding on that code, you would think this would work, but it doesn't;
    <cfloop from="1" to="#Session.NumberOfSurveyFields#" index="arrayindex">
    <cfset thislocalfield = Session.SurveyField[arrayindex]>
    <cfscript>
    thissessionfield = "Session." & thislocalfield;
    thisformfield = "Form." & thislocalfield;
    </cfscript>
    <!--- debug --->
    <!--- <cfoutput>#thissessionfield# = "#evaluate(thisformfield)#"</cfoutput><br> --->
    <cfoutput>
    <cfset #thissessionfield# = "#evaluate(thisformfield)#">
    </cfoutput>
    </cfloop>
    And see that debug code in the middle? To add insult to injury... When I uncomment that it shows me this. So it certainly looks like this should work....
    Session.q01_name = "Me"
    Session.q02_AcadTechORNA = "N/A"
    Session.q03_Water = "Yes (certificate expired)"
    Session.q04_FirstAid = "Yes (certificate is current)"
    Session.q05_CPR = "No"
    Session.q06_LifeGuard = "Yes (certificate expired)"
    Session.q07_AED = "Yes (certificate expired)"
    Session.q08_ProjAdv = "Yes (certificate expired)"
    Session.q09_Color = "Gray"
    Session.q10_SantaClaus = "Yes"
    Session.q11_Supervisor = "Da Boss"
    Session.q12_SupervisorOpinion = "Not a bad thing"
    There must be some simpler way to do this. This way won't work against all odds even though it seems so much like it should.
    So I end up having to hardcode it; still looking for an automated way to set these #@%$*@!## session variables over the list from the form variables of the same @#@!$#%$%# name. Do I sound frustrated???
    No matter what I do, if I don't HARDCODE like this;
    <cfset Session.q01_name = Form.q01_name>
    <cfset Session.q02_AcadTechORNA = Form.q02_AcadTechORNA>
    <cfset Session.q03_Water = Form.q03_Water>
    <cfset Session.q04_FirstAid = Form.q04_FirstAid>
    <cfset Session.q05_CPR = Form.q05_CPR>
    <cfset Session.q06_LifeGuard = Form.q06_LifeGuard>
    <cfset Session.q07_AED = Form.q07_AED>
    <cfset Session.q08_ProjAdv = Form.q08_ProjAdv>
    <cfset Session.q09_Color = Form.q09_Color>
    <cfset Session.q10_SantaClaus = Form.q10_SantaClaus>
    <cfset Session.q11_Supervisor = Form.q11_Supervisor>
    <cfset Session.q12_SupervisorOpinion = Form.q12_SupervisorOpinion>
    I always get this from my next page because the session variables are empty;
    You must answer question 1.
    You must answer question 2.
    You must answer question 3.
    You must answer question 4.
    You must answer question 5.
    You must answer question 6.
    You must answer question 7.
    You must answer question 8.
    You must answer question 9.
    You must answer question 10.
    I tried duplicate as well, but I can not get the above to work...
    Can anyone help me do this thing that one would think is simple????

    I think if you use structure array syntax you should get the results you want.
    <cfloop from="1" to="#Session.NumberOfSurveyFields#" index="arrayindex">
          <cfset session[Session.SurveyField[arrayindex]] = Form[Session.SurveyField[arrayindex]]>
    </cfloop>
    Or probably even easier.
    <cfset session = duplicate(form)>

Maybe you are looking for

  • Dreamweaver/Flash literature

    I am switching from GoLive to Dreamweaver and Flash. I am using the Classroom in a Book tutorials to familiarize myself with those applications, but can already tell they're only scratching the surface. Therefore I'd like to know what literature is r

  • Connection Pooling in OLTP Tux Processes

    Hi All , Was wondering if I could control the number of DB connections in the same way the jdbc connection pooling occurs for C programs. It is an OLTP design and if there are 50 servers running I want just 20 DB connections to be shared among them a

  • Recommend Monitor and Webcam?

    Hi I have never bought a mac and have little computer literacy. I want to buy a mac mini and want a suggestion for ~ 20-22" monitor and webcam. Is the agent v4 webcam any good? thanks

  • Worksheet gives gray background on query run and won't give back.

    When I run either multiple queries within a single worksheet or an running any code over 1 line long, the worksheet highlights the entire query with a dark gray background, just like the old Tora or Toad, which is fine. However, unlike Tora or Toad,

  • Synch Outlook Shared Contacts

    I have a user who needs to access her boss's contacts(as well as her own) on her blackberry. Her email etc is handled thru Outlook 2007/Exchange 2007 / BES.  Her Outlook contacts synch correctly but her boss's shared contacts are not being synched to