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

27
Supercharge Your Parameterized HTML Launch Pages With 7.6.9+ Advanced Chaining Techniques! Dan Pinault Power Systems Research Copyright 2010, Information Builders. Slide 1

description

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?. - PowerPoint PPT Presentation

Transcript of 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 PinaultPower Systems Research

Copyright 2010, Information Builders. Slide 1

Basic Chaining in HTML Composer

Copyright 2010, Information Builders. Slide 2

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’)]

Copyright 2010, Information Builders. Slide 3

Simple Chaining HTML Composer Design Screen

Copyright 2010, Information Builders. Slide 4

Simple Chaining HTML Composer Parameters Screen

Copyright 2010, Information Builders. Slide 5

Simple Chaining Run Time Example

Copyright 2010, Information Builders. Slide 6

The Problem

Copyright 2010, Information Builders. Slide 7

Long Lists Can Cause Issues

Copyright 2010, Information Builders. Slide 8

The “Aha!” moment

Copyright 2007, Information Builders. Slide 9

Advanced chaining technique – Step1

Copyright 2007, Information Builders. Slide 10

This drop-down list allows the user to select one of the Master Files they have access to.

Step1 – Parameters Tab – Data Source Selector

Copyright 2007, Information Builders. Slide 11

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 SYSTABLESUM

FST.REMARKSBY NAME

&FILELIST.EVAL ON TABLE PCHOLD FORMAT XMLEND

Copyright 2007, Information Builders. Slide 12

Advanced chaining technique – Step2

Copyright 2007, Information Builders. Slide 13

The values in this drop-down list are determined by the Master File selected in the

Data Source Selector.

Step2 – Parameters Tab –Field Name Selector

Copyright 2007, Information Builders. Slide 14

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_HLDSUM

FST.TITLEBY FIELDNAME

ON TABLE PCHOLD FORMAT XMLEND

Copyright 2007, Information Builders. Slide 15

Advanced chaining technique – Step3

Copyright 2007, Information Builders. Slide 16

The values in this list-box are determined by the selected item in the Field Name Selector.

Step3 – Parameters Tab – Data Value Selector

Copyright 2007, Information Builders. Slide 17

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 &DATASOURCESUM

FST.&FIELDNAME AS FIELDVALSBY &FIELDNAME AS FIELDVALS

ON TABLE PCHOLD FORMAT XMLEND

Copyright 2007, Information Builders. Slide 18

Advanced chaining technique – Step4

Copyright 2007, Information Builders. Slide 19

Adding the Guide Words Selector allows the user to ‘page’ through a long list of Data

Values in the Data Value Selector.

Step4 – Parameters Tab – Guide Words Selector

Copyright 2007, Information Builders. Slide 20

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/HOLDKEYSEND-RUN

Copyright 2007, Information Builders. Slide 21

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_HLDTABLE FILE DS_HLD

SUMFST.FORMAT

WHERE FIELDNAME EQ '&FIELDNAME';ON TABLE SAVEEND-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';

Copyright 2007, Information Builders. Slide 22

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/HOLDKEYSSUM

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 BLOCKON TABLE SET HOLDLIST PRINTONLY AND ASNAMES ONON TABLE PCHOLD FORMAT XMLEND

Copyright 2007, Information Builders. Slide 23

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/HOLDKEYSSUM

FST.&FIELDNAME AS FIELDVALSBY &FIELDNAME AS FIELDVALS

WHERE BLOCK EQ █ON TABLE PCHOLD FORMAT XMLEND

Copyright 2007, Information Builders. Slide 24

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

Copyright 2007, Information Builders. Slide 25

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

Copyright 2007, Information Builders. Slide 26

Questions?

Copyright 2007, Information Builders. Slide 27

Dan [email protected]