Represents a list of key value pairs stored and generated from a POST method of an HTML form. Form elements are the controls that enable users to make selections on HTML pages. When a browser collects data from HTML forms, it directs it to a Hyper Text Transfer Protocol (HTTP) server indicated in the HTML Form, and starts the Data Access Servlet (DAServlet). The DAServlet collects the form values and packages them for the Interactive Reporting document (.bqy). The Form (Object) provides read-only access to the form elements values. Because HTML forms are browsers-based this collection applies only to the Interactive Reporting document (. bqy). However, the Form (Object) is exposed in client server products for plug-in scripts.
If you develop HTML Forms for Interactive Reporting, note the following:
Method—Specifies how data passes to the server when forms are submitted. Send forms using GET or POST methods. GET sends from results in the URL submitted to the script. POST encodes data sent to the script. The script in the following example uses the POST method.
Action—Defines how forms are processed and when they are submitted to the Data Access Servlet (part of Hyperion Foundation Suite 8). Actions contain the location of BQY documents.
JScript=enable—Key-value pair that enables browsers to read and access JavaScript.
(input)—
Form fields ares referred to as an input items (the HTML tag is <input>). Input item are depicted in form output by a name and value. The name indicates the script handling the for uses. The value is the content. These form fields are available:
Hidden text—Invisible to users. Hold unique data passed between server and client that may include information to be accessed later, such as date values.
Text Field—Single or multiple lines. Text fields are handy for short and long answers to questions. Default size is one row by 20 rows.
Check box—Enables users to select one answer.
Radio buttons—Consist of a group of two or more buttons. Users can select only one button in a group. Other selected button are cleared.
Select values—Creates a drop-down that enables users to select from a list of items.
The Session.Form.Add () and Session.Form.Item() object model syntax is not supported in EPM Workspace. |
Note: | If a form launches the Interactive Reporting Web Client with the “withnav” variant of the Smartcut, the Session.Form collection items is inaccessible. In this instance, use withnav_get or withnav_run. This behavior can be set as the default mode for a Smartcut by editing the ws.conf line to show: WebClient.UserInterface.Navigation.ShowNavigationBar=true |
All collections have the “Item(NameOrIndex) method.” This is the default method for all collections that returns collection items at a particular index or by name. Use brackets ([]) to represent calls to the Item (Method). For example, these statements are identical: myItem = Documents[1] myItem = Documents.Item(1) myItem = Documents["StartUp.bqy"] myItem = Documents.Item("StartUp.bqy") |
This example shows how to read values of a Form elements and use them in a plug-in script:
<HTML> <BODY> <!"Note: The Action Key have a value which opens a document from the web client. You MUST include the "Jscript=enable" key-value pair to initialize the plug-in scripting -> <FORM METHOD = "post" ACTION = "http://your.server.com/ods-cgi/odscgi.exe?Method=getDocument&Docname=-1835-83481598112-58541278350-125-8-1-1387-9434&JScript=enable"> <P>Text Box <INPUT id=text1 name=text1></P> <P>Password <INPUT id=password1 name=password1 type=password></P> <P>Text Area <TEXTAREA id=TEXTAREA1 name=TEXTAREA1></TEXTAREA></P> <P>Check Box<INPUT id=checkbox1 name=checkbox1 type=checkbox></P> <P>Radio <INPUT id=radio1 name=radio1 value = "1st" type=radio><INPUT id=radio1 name=radio1 type=radio value = "2nd" CHECKED></P> <P>DropDown<SELECT id=select1 name=select1 > <OPTION value=Value1>Display1 <OPTION value=Value4>Display4</SELECT></P> <P>ListBox <SELECT id=select2 name=select2 size=4 multiple> <OPTION value=Value1>List1 <OPTION value=Value4>List4</SELECT></P> <P><INPUT id=submit1 name=submit1 type=submit value=Submit></P> </FORM> </BODY> </HTML> //Script running on plug-in //Write all values to console window Console.Writeln("Text1 Value = "+ Session.Form["text1"]) Console.Writeln("password1 Value = "+ Session.Form["password1"]) Console.Writeln("TEXTAREA1 Value = "+ Session.Form["TEXTAREA1"]) Console.Writeln("checkbox1 Value = "+ Session.Form["checkbox1"]) Console.Writeln("radio1 Value = "+ Session.Form["radio1"]) Console.Writeln("select1 Value = "+ Session.Form["select1"]) Console.Writeln("select2 Value = "+ Session.Form["select2"])
The following example shows how to pass store code entered in a form text field to Interactive Reporting documents. Values are passed and written to the Console window, passed as limit value, and then the queries processed.
The first part of this example shows an HTML file collects the form value field:
The StoreSales.htm and bqy show how to pass a form value and apply it as a limit:
<HTML> <BODY> <FORM METHOD = "post" ACTION = "http://elearn.hyperion.com/Hyperion/dataaccess/Browse?REQUEST_TYPE=GET_DOCUMENT&DOC_UUID=000000f5f703e795-0000-0404-40a02b5e&DOC_VERSION=1&JScript=enable"> <p align="center"><font face="Verdana, Arial, Helvetica, sans-serif"><b><font size="5">Store Sales by Product Name - 2001</font></b></font></p> <p>Please enter your store code: <input type="text" name="storecode"></P> <P><INPUT id=submit1 name=submit1 type=submit value=Submit></P> </FORM> </BODY> </HTML>
The second part of the example shows how a document script was scripted to collect and write the values on an OnStartup event:
//Write all values to console window var storecode = Session.Form["storecode"]; Console.Writeln(storecode); var StoreCodeLimit = ActiveDocument.Sections["Query"].Limits["Store Code"]; StoreCodeLimit.SelectedValues.RemoveAll(); StoreCodeLimit.SelectedValues.Add(storecode); ActiveDocument.Sections["Query"].Process();
This example shows how to read values of Form elements within an HTML file and pass them to the Interactive Reporting Web Client. Passed values are displayed in the Console Window.
The URL cited reflects the URL name of Interactive Reporting Web Client which was published using Hyperion Foundation Suite 8.0. To determine the URL of Interactive Reporting Web Client, perform these tasks:
Log on to Hyperion Foundation Suite 8.
Access the selected Interactive Reporting document.
Position the cursor on the Interactive Reporting Web Client icon for the document.
Right-click and select properties.
Copy and paste the URL into the HTML file.
The first part of the example shows how the HTML file was coded to collect form value fields. From the text input type, the state location value is passed. From the radio input type, the college-level value is passed. From the check box input type, the book title is passed. From the select name input type field, the State/Province value is passed:
<HTML> <BODY> <!"Note: The Action Key have a value which opens a document from the web client. You MUST include the "Jscript=enable" key-value pair to initialize the plug-in scripting -> <FORM METHOD = "post" ACTION = "http://elearn.hyperion.com/Hyperion/dataaccess/Browse?REQUEST_TYPE=GET_DOCUMENT&DOC_UUID=000000f56c19b5c5-0000-0404-40a02b5e&DOC_VERSION=1&JScript=enable> <p align="center"><font face="Verdana, Arial, Helvetica, sans-serif"><b><font size="5">Book Purchase Survery</font></b></font></p>Metro Bookseller Store Location <input type="text" name="storelocation"></P> </p> <input type="text" name="state"></P> </p> <p>Choose your college year: <input type="radio" name="radiobutton1" value="freshman"> freshman <input type="radio" name="radiobutton2" value="sophmore"> sophmore <input type="radio" name="radiobutton3" value="junior"> junior <input type="radio" name="radiobutton4" value="senior"> senior</p> <p>Choose your favorite books (select as many as apply):</p> <p> <input type="checkbox" name="checkbox" value="The DataWarehouse Toolki"> The DataWarehouse Toolkit</p> <p> <input type="checkbox" name="checkbox2" value="A Short History of Byzantium"> A Short History of Byzantium</p> <p> <input type="checkbox" name="checkbox3" value="A Course in Game Theory"> A Course in Game Theory</p> <p> <input type="checkbox" name="checkbox4" value="Brilliant Deductions"> Brilliant Deductions</p> <p>Select your home state: <select name="state_province"> <option>California</option> <option>New York</option> <option>Texas</option> </select> </p> <P><INPUT id=submit1 name=submit1 type=submit value=Submit></P> </FORM> </BODY> </HTML>
In the second part of the example, the Document OnStartup script writes the values passed from the HTML form; the variable names correspond to the control (input) names set in the HTML document:
//Write all values to console window Console.Writeln("Text Value = "+ Session.Form["storelocation"]) Console.Writeln("radiobutton Value1 = "+ Session.Form["radiobutton1"]) Console.Writeln("radiobutton Value2 = "+ Session.Form["radiobutton2"]) Console.Writeln("radiobutton Value3 = "+ Session.Form["radiobutton3"]) Console.Writeln("radiobutton Value4 = "+ Session.Form["radiobutton4"]) Console.Writeln("checkbox Value = "+ Session.Form["checkbox"]) Console.Writeln("checkbox2 Value = "+ Session.Form["checkbox2"]) Console.Writeln("checkbox3 Value = "+ Session.Form["checkbox3"]) Console.Writeln("checkbox4 Value = "+ Session.Form["checkbox4"]) Console.Writeln("select Value = "+ Session.Form["state_province"])
Add(Key As String, Value As String), Item(NameorIndex) As Form