200 likes | 216 Views
Week 11 April 12. Lexical Reference Variables in Graphics and List Box in Forms. Hard-Coded Values. Will only show one year No flexibility. A Few Simple Steps. In Graphics Builder… Create a user parameter Assign an initial value Modify the data model
E N D
Week 11April 12 Lexical Reference Variables in Graphics and List Box in Forms
Hard-Coded Values Will only show one year No flexibility
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
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
Create a Lexical Reference Variable Select Parameters and the create tool in the tool palette
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.
Using the Lexical Reference Variable Replace with the lexical reference variable Replace the column name with the lexical reference variable
Using the Lexical Reference Variable Alias must be used Click Apply to test the syntax and OK to close the window
Create the List Item Click on the list item tool in the tool palette and draw the list item on the canvas
Populate the List Item Right-mouse click on the list item (e.g., LIST10) and select the Property Palette
Populate the List Box 1. Select the Elements in List property, enter the elements and values, click on OK Must correspond Value associated with the list element 2. Assign an Initial Value (set to blank)
Navigator Block name Chart item name (Remember these names) List item name
Program the Push Button Right-mouse click on the push button and select PL/SQL Editor
Programming the Push Button 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 append it to the literal (“sum(sales…”) See next slide
Programming the Push Button See next slide Assigns the variable revenue_year to the lexical reference variable, p_rev_column