Focal Point
[CLOSED] Add a record to a report result programmatically

This topic can be found at:
https://forums.informationbuilders.com/eve/forums/a/tpc/f/7971057331/m/8877071616

February 02, 2012, 09:32 AM
shelzalee
[CLOSED] Add a record to a report result programmatically
I’m using a FEX to populate a drop down list in HTML Composer. This drop down list is chained to a radio button control that filters what the drop down list is filled with depending on what is selected in the radio control. In one radio button selection, I may need to add an ‘All’ option to the results that populate the drop down list. If the other two options on the radio button are selected, I will not need the all option. I don’t believe I’ll be able to use the ‘Add ALL option’ on the properties of the drop down list since I don’t always want the ALL option. This leaves me with adding a record to the report results from the FEX that populates the drop down list based on what criteria is passed to it from the chained radio control.

How do you programmatically add a record to a report? The report is currently being populated directly from joined tables.

Thanks,
shelz.

This message has been edited. Last edited by: Kerry,
February 02, 2012, 10:31 AM
KenFR
quote:
matically

You could branch to a conditional MODIFY and add a row to your results


8105 Tomcat and AIX reporting server
input: Teradata, SQL, DB2, Essbase, Oracle, text
output:html, excel, PDF,
February 02, 2012, 10:40 AM
shelzalee
I'm new to focus. Could you provide a coding example of branching to a conditional modify?

Thanks,
shelz.


7.7 Windows HTML, PDF, Excel
February 02, 2012, 11:43 AM
Francis Mariani
"I'm new to focus" - "branching to a conditional modify" - These are mutually exclusive.

Look into the MORE command with which you can concatenate more than one file. You can bypass the second file depending on a condition. Here's an example:

-SET &COND_VAL = EDIT(&YYMD,'$$$$99$$');

TABLE FILE CAR
SUM
COUNTRY
BY COUNTRY
WHERE NOT COUNTRY CONTAINS 'I'
ON TABLE HOLD AS H001
END

TABLE FILE CAR
SUM
COUNTRY
BY COUNTRY
WHERE COUNTRY CONTAINS 'I'
ON TABLE HOLD AS H002
END

TABLE FILE H001
SUM
COUNTRY
BY COUNTRY
ON TABLE PCHOLD FORMAT XML

-IF &COND_VAL EQ '01' GOTO BYPASS1;

MORE
FILE H002

-BYPASS1
END



Francis


Give me code, or give me retirement. In FOCUS since 1991

Production: WF 7.7.05M, Dev Studio, BID, MRE, WebSphere, DB2 / Test: WF 8.1.05M, App Studio, BI Portal, Report Caster, jQuery, HighCharts, Apache Tomcat, MS SQL Server
February 02, 2012, 12:30 PM
Dan Satchell
When you check the "Add ALL Option" properties box, HTML Composter adds a parameter named dynalldisplayvalue to the HTML statement for the object and sets its value to "ALL" (dynalldisplayvalue="ALL"). So I would imagine that one could use JavaScript to dynamically change the value of this parameter.


WebFOCUS 7.7.05
February 03, 2012, 01:18 PM
shelzalee
Well, I've tried a couple of things and not found a solution for only including ALL when needed.

I was able to add the all option to the FEX that populates the drop down list based on criteria passed to it. When I run the FEX stand alone, the all option displays as expected depending on the criteria passed. However, for some reason, when it is used to populate the drop down list, the all option never displays.

So I pursued only adding the all option in JavaScript when needed. For some reason, the event which is on the onlick of a radio button span always fires twice, adding all twice.

I give up going this route. I'll just change the report to accept the radio button parameter, leave the all on for all options and filter the report on the radio type selected. This involves more changes than I wanted to make, but I don't want to open an issue with IBI, and this may make the report function better any way.


7.7 Windows HTML, PDF, Excel
February 03, 2012, 01:22 PM
Francis Mariani
Yup - the radio button onclick fires twice - very annoying.

"when it is used to populate the drop down list, the all option never displays" - I wonder whye...


Francis


Give me code, or give me retirement. In FOCUS since 1991

Production: WF 7.7.05M, Dev Studio, BID, MRE, WebSphere, DB2 / Test: WF 8.1.05M, App Studio, BI Portal, Report Caster, jQuery, HighCharts, Apache Tomcat, MS SQL Server