Jump to content

I have an HTML-driven report that runs parallel code using s...


Scott Zak 3

Recommended Posts

Hi Scott - welcome to myibi!

I dont have an answer for you, but I did some research to see when this started happening.

Looks like it started in 8205 - the Release notes say this:

 

In Release 8205, dynamically populated controls in an HTML page do not display an All

option if there is only one available value. You can display the All option for dynamically

populated controls with multiple available values by selecting the control object, opening

the Settings panel, and selecting the Add All option check box.

 

With this documented, as far as the All selection goes, IBI will say thats just how it is now.

With that said, I think this is an Upward Compatibility issue (internally called a UC).

You could open a case complaining about it. If you open a case, send them an example CM export that illustrates the differences.

With that said, if youre in a hurry, it may be better to just suck it up and make the changes you need to make. Fixes are sometimes taking really long to get done (assuming they agree that it should be fixed). Im still waiting on a fix to the reporting server thats being worked on. Its been over a year. So if you want to make sure your stuff works like you want, re-writing your code might be faster.

You could do both really - open a case to complain and send the CM package and some screenshots illustrating the problem. Maybe theres some easy way around it that we dont know. If theyre moving slow, then start re-writing.

Maybe somebody else here in myibi has an idea how to fix that issue too. Seems like displaying All should be something that stays the same with one row present.

Good luck!

Link to comment
Share on other sites

I have an HTML-driven report that runs parallel code using several distinct database adapters/connectors based on a user-selected parameter. Subsequent chained parameter selection controls are populated by code to filter the data returned in the report.

In some cases, the report should contain rows where the field being filtered has missing values (null). The parameter population code returns all non-null values and may yield zero, one or more than one value depending on the data connection selected. The population results never include a row for missing/null. The default behavior on the report should be to return all rows (no filtering).

On the control settings in the AppStudio, we have the Add All option set.

This worked fine in 8.2.0.4. On upgrade to 8207, however, the parameter population is wrong. The report runs fine when there are no non-null values to select or when there are two or more. In the case where the population selection code returns exactly one non-null value, no All option is created and the single value is selected by default. This filters out any rows where the filtered field has missing/null data. Hilarity ensues.

In the 8207 AppStudio User Manual (page 573) appears the following note: If the dynamic list contains only one value, the All option does not display in the control. This note doesnt appear in the 8.2.0.4 manual. So the change in behavior appears to be a feature (thanks! ).

Is there a simple workaround Or do I need to crap up my population selection code to ensure that it always returns zero or 2+ non-null rows

Link to comment
Share on other sites

Thanks, Toby. I appreciate your taking the time to respond.

I have a case open, and IBI support is looking.

As a follow-up, if you or anyone else reading knows an elegant way to structure a reporting language query to conditionally append a literal row to a results set, I sure would be glad to hear it.

Thanks again.

Link to comment
Share on other sites

I normally built my own list with All from a fex that creates the desired data and js to populate in html

So in the fex, here is a simple sample

DEFINE FILE GGPRODS

TRI /A4 = '1';

TRIA /A4 = '0';

CODE /A10V = PRODUCT_ID;

CODEA /A10V = '_FOC_NULL';

LST /A20V = LCWORD3(16, PRODUCT_DESCRIPTION, 'A16V');

LSTA /A20V = 'All';

END

 

TABLE FILE GGPRODS

SUM LSTA AS 'LST'

BY TRIA AS 'TRI'

BY PRODUCT_ID

BY CODEA AS 'CODE'

WHERE READLIMIT EQ 1;

ON TABLE HOLD

END

-RUN

 

TABLE FILE GGPRODS

SUM LST AS 'LST'

BY TRI NOPRINT

BY PRODUCT_ID NOPRINT

BY CODE AS 'CODE'

ON TABLE PCHOLD FORMAT XML

MORE

FILE HOLD

END

-RUN

Link to comment
Share on other sites

Hi Scott,

I experienced the same behavior with the upgrade to 8207. The ALL dropdown option no longer appears when only one value is returned in the dropdown. I did receive some javascript code to force the ALL to appear in the dropdown. It was an easy fix but caused much grief.

javascript code:

function onInitialUpdate() {

var lb = IbComposer_getComponentById(cboMoistProgram);

if (lb.length == 1) { addAllOption(lb); };

IbComposer_setCurrentSelection (cboMoistProgram, _FOC_NULL, true);

var lb = IbComposer_getComponentById(cboVaporProgram);

if (lb.length == 1) { addAllOption(lb); };

IbComposer_setCurrentSelection (cboVaporProgram, _FOC_NULL, true);

var lb = IbComposer_getComponentById(cboVaporComponenet);

if (lb.length == 1) { addAllOption(lb); };

IbComposer_setCurrentSelection (cboVaporComponenet, _FOC_NULL, true);

}

function addAllOption( obj ) {

var addOption = document.createElement(option);

addOption.text = ALL;

addOption.value= _FOC_NULL;

obj.add(addOption,0);

}

Link to comment
Share on other sites

While working on this I stumbled on a solution that is working for me (YMMV). I turned off the Add all option entirely and used the Add No selection option in its place. I changed the label to match what was previously there:

 

With nothing selected no value is passed to the controlling variable. The variables DEFAULT value in the code skips the condition clause entirely. Therefore no value selected means the query is unfiltered, yielding all values as intended.

It even looks intuitive in the form:

 

And when dropdown is expanded:

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
  • Create New...