1 / 27

Supercharge Your Parameterized HTML Launch Pages With 7.6.9+ Advanced Chaining Techniques!

Supercharge Your Parameterized HTML Launch Pages With 7.6.9+ Advanced Chaining Techniques!. Dan Pinault Power Systems Research. Basic Chaining in HTML Composer. What is Chaining?.

eldon
Download Presentation

Supercharge Your Parameterized HTML Launch Pages With 7.6.9+ Advanced Chaining Techniques!

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Supercharge Your Parameterized HTML Launch Pages With 7.6.9+ Advanced Chaining Techniques! Dan Pinault Power Systems Research

  2. Basic Chaining in HTML Composer

  3. What is Chaining? • A method of selectively reducing the number of options in ‘downstream’ controls based on selections made in ‘upstream’ controls. • Typically used with data fields that have a hierarchical or one-to-many relationship (does not imply data file structure) • Prevents users from making selections that will not return any data [i.e. (Region EQ ‘Central Asia’) and (Country EQ ‘United States’)]

  4. Simple Chaining HTML Composer Design Screen

  5. Simple Chaining HTML Composer Parameters Screen

  6. Simple Chaining Run Time Example

  7. The Problem

  8. Long Lists Can Cause Issues

  9. The “Aha!” moment

  10. Advanced chaining technique – Step1 This drop-down list allows the user to select one of the Master Files they have access to.

  11. Step1 – Parameters Tab – Data Source Selector

  12. Let’s take a closer look – Data Source Selector -* Code to populate combobox1 Data Source Dropdown List control. -* Use value of &&IBI_IF_FILE to create list of available Master Files. -* Need to evaluate &&IBI_IF_FILE before TABLE Request because Dialog -* Manager command -INCLUDE can not evaluate variable inside TABLE Request. -SET &FILELIST = '-INCLUDE ' | &&IBI_IF_FILE; TABLE FILE SYSTABLE SUM FST.REMARKS BY NAME &FILELIST.EVAL ON TABLE PCHOLD FORMAT XML END

  13. Advanced chaining technique – Step2 The values in this drop-down list are determined by the Master File selected in the Data Source Selector.

  14. Step2 – Parameters Tab –Field Name Selector

  15. Let’s take a closer look – Field Name Selector -* Code to populate combobox2 Field Name Dropdown List control. -* Default Amper-Variables because list will populate when HTML page loads. -DEFAULT &DATASOURCE = SUMMIT2010DATA; CHECK FILE &DATASOURCE HOLD AS DS_HLD TABLEF FILE DS_HLD SUM FST.TITLE BY FIELDNAME ON TABLE PCHOLD FORMAT XML END

  16. Advanced chaining technique – Step3 The values in this list-box are determined by the selected item in the Field Name Selector.

  17. Step3 – Parameters Tab – Data Value Selector

  18. Let’s take a closer look – Data Value Selector -* Code to populate listbox1 Data Values List control. -* Set ASNAMES on to allow for custom data field and display field. SET ASNAMES = ON -* Default Amper-Variables because list will populate when HTML page loads. -DEFAULT &DATASOURCE = SUMMIT2010DATA; -DEFAULT &FIELDNAME = REGIONNAME; TABLE FILE &DATASOURCE SUM FST.&FIELDNAME AS FIELDVALS BY &FIELDNAME AS FIELDVALS ON TABLE PCHOLD FORMAT XML END

  19. Advanced chaining technique – Step4 Adding the Guide Words Selector allows the user to ‘page’ through a long list of Data Values in the Data Value Selector.

  20. Step4 – Parameters Tab – Guide Words Selector

  21. Let’s take a closer look – Guide Words Selector (1 of 3) -* Code to populate combobox3 Guide Words Dropdown List control -* Default Amper-Variables because list will populate when HTML page loads. -DEFAULT &DATASOURCE=SUMMIT2010DATA; -DEFAULT &FIELDNAME=REGIONNAME; -DEFAULT &BLOCKSIZE=500; -DEFAULT &BLOCK=0; -* First pass assigns each row to a block number based on the value of &BLOCKSIZE. TABLE FILE &DATASOURCE SUM COMPUTE ROWNUM/I7 = LAST ROWNUM-(-1); COMPUTE BLOCK /I5 = 1-(-(INT((ROWNUM-1)/&BLOCKSIZE))); BY &FIELDNAME WHERE &FIELDNAME IS NOT MISSING; ON TABLE HOLD AS FOCCACHE/HOLDKEYS END -RUN

  22. Let’s take a closer look – Guide Words Selector (2 of 3) -* Second pass is to get the format of the selected field so we can determine how -* to convert the values to a string format so the values can be concatenated. CHECK FILE &DATASOURCE HOLD AS DS_HLD TABLE FILE DS_HLD SUM FST.FORMAT WHERE FIELDNAME EQ '&FIELDNAME'; ON TABLE SAVE END -RUN -* Put the field format value into &FIELDTYPE and convert field value to string. -READ SAVE &FLDTYPE.A8. -SET &FLDINIT = EDIT(&FLDTYPE,'9$'); -SET &XFIELD = - IF (&FLDINIT EQ 'I') THEN 'EDIT(&FIELDNAME.EVAL)' - ELSE IF (&FLDINIT EQ 'P') THEN 'PTOA(&FIELDNAME.EVAL, ''(&FLDTYPE.EVAL)'', ''A99V'')' - ELSE IF (&FLDINIT EQ 'D' OR 'F') THEN 'FTOA(&FIELDNAME.EVAL, ''(&FLDTYPE.EVAL)'', ''A99V'')' - ELSE '&FIELDNAME.EVAL';

  23. Let’s take a closer look – Guide Words Selector (3 of 3) -* Remove leading zeros if they exist. DEFINE FILE FOCCACHE/HOLDKEYS FLDNAM/A99V = (TRIMV('L', &XFIELD, 99, '0', 98, 'A99V')); END TABLEF FILE FOCCACHE/HOLDKEYS SUM FST.ROWNUM AS LOROW NOPRINT LST.ROWNUM AS HIROW NOPRINT -* Build Guide Words entry from first and last FLDNAM in each block. COMPUTE RANGE/A99V = IF (LST.ROWNUM GT FST.ROWNUM) THEN FST.FLDNAM || ' ~ ' | LST.FLDNAM ELSE FST.FLDNAM; BY BLOCK ON TABLE SET HOLDLIST PRINTONLY AND ASNAMES ON ON TABLE PCHOLD FORMAT XML END

  24. Let’s take a closer look – Data Value Selector (v2) -* Code to populate listbox1 Data Values List control when used with Guide Words control. -* Set ASNAMES on to allow for custom data field and display field. SET ASNAMES = ON -* Default Amper-Variables because list will populate when HTML page loads. -DEFAULT &FIELDNAME = REGIONNAME; -DEFAULT &BLOCK = 1; TABLEF FILE FOCCACHE/HOLDKEYS SUM FST.&FIELDNAME AS FIELDVALS BY &FIELDNAME AS FIELDVALS WHERE BLOCK EQ █ ON TABLE PCHOLD FORMAT XML END

  25. Putting it all together – A Real-World Example (1 of 2)

  26. Putting it all together – A Real-World Example (2 of 2)

  27. Questions? Dan Pinault dpinault@powersys.com

More Related