1 Week 11 April 12 • Lexical Reference Variables in Graphics and List Box in Forms R. Ching, Ph.D. • MIS Area • California State University, Sacramento Hard-Coded Values Will only show one year No flexibility R. Ching, Ph.D. • MIS Area • California State University, Sacramento 2 A Few Simple Steps • In Graphics Builder… – Create a user parameter • Assign an initial value – Modify the data model • Insert the lexical reference variable into the query • In Forms Builder – Create a list item • Populate the list box • Assign an initial value R. Ching, Ph.D. • MIS Area • California State University, Sacramento 3 A Few Simple Steps (cont.) – Create a push button to launch the graph in the chart item – Program the push button in PL/SQL • Create a paramlist variable • Concatenate the list item’s value to the text for the column name to form a text string • Add the text string to the parameter list • Open the graph – Run the form R. Ching, Ph.D. • MIS Area • California State University, Sacramento 4 5 In Graphics Builder R. Ching, Ph.D. • MIS Area • California State University, Sacramento Create a Lexical Reference Variable Select Parameters and the create tool in the tool palette R. Ching, Ph.D. • MIS Area • California State University, Sacramento 6 Assign a Name and Initial Value Assign entries into the Name and Initial Value dialog boxes. Be sure the Type is character (char). Click OK. R. Ching, Ph.D. • MIS Area • California State University, Sacramento 7 Using the Lexical Reference Variable 8 Replace with the lexical reference variable Replace the column name with the lexical reference variable R. Ching, Ph.D. • MIS Area • California State University, Sacramento Using the Lexical Reference Variable Alias must be used Click Apply to test the syntax and OK to close the window R. Ching, Ph.D. • MIS Area • California State University, Sacramento 9 10 In Form Builder R. Ching, Ph.D. • MIS Area • California State University, Sacramento Create the List Item Click on the list item tool in the tool palette and draw the list item on the canvas R. Ching, Ph.D. • MIS Area • California State University, Sacramento 11 Populate the List Item Right-mouse click on the list item (e.g., LIST10) and select the Property Palette R. Ching, Ph.D. • MIS Area • California State University, Sacramento 12 Populate the List Box Must correspond 13 1. Select the Elements in List property, enter the elements Value associated and values, with the list click on OK element 2. Assign an Initial Value (set to blank) R. Ching, Ph.D. • MIS Area • California State University, Sacramento Navigator 14 Block name Chart item name (Remember these names) List item name R. Ching, Ph.D. • MIS Area • California State University, Sacramento Program the Push Button 15 Right-mouse click on the push button and select PL/SQL Editor R. Ching, Ph.D. • MIS Area • California State University, Sacramento Programming the Push Button 16 Create a parameter list (runlist) If nothing is selected from the list box Take the year (i.e., last 2 digits) from the list box and See next slide append it to the literal (“sum(sales…”) R. Ching, Ph.D. • MIS Area • California State University, Sacramento Programming the Push Button 17 See next slide Assigns the variable revenue_year to the lexical reference variable, p_rev_column R. Ching, Ph.D. • MIS Area • California State University, Sacramento block3.d_caption 18 R. Ching, Ph.D. • MIS Area • California State University, Sacramento 19 R. Ching, Ph.D. • MIS Area • California State University, Sacramento 20 R. Ching, Ph.D. • MIS Area • California State University, Sacramento