Focal Point
[CLOSED] Creation of graph based on check box selection

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

January 16, 2014, 05:43 AM
Praneeth Maguluri
[CLOSED] Creation of graph based on check box selection
I have created a check box before every row in my output.Now I want to create a bar chart based on selection of check box in my report output.
Please help me on this in providing the code

-----------Here is my code for creation of checkbox before every row-----------

DEFINE FILE CAR
ID1/I5 WITH MODEL =LAST ID1 + 1;
AID1/A5 = FPRINT(ID1, 'I5' , 'A5');
AID2/A5 = TRIM('L', AID1, 5, ' ', 1, 'A5');
CB/A100 = '';
END

TABLE FILE CAR
HEADING
"Car Report checkbox"
" "
PRINT
CB AS ''
'CAR.ORIGIN.COUNTRY'
'CAR.COMP.CAR'
'CAR.CARREC.MODEL'
'CAR.BODY.BODYTYPE'

ON TABLE HOLD FORMAT AHTMLTAB AS REPORT2
ON TABLE SET STYLE *
TYPE=HEADING, SIZE=20, STYLE=BOLD,COLOR=GREEN, $
ENDSTYLE
END
-RUN

-HTMLFORM BEGIN
!IBI.OBJ.ACTIVEREPORTJS;

<script>
function showCheckedItems() {
var _allCbxs = document.getElementsByTagName("input");
var _length = _allCbxs.length;
var _params = "";

for (var i=0; i < _length; i++) {
if (_allCbxs[i].type == "checkbox" && _allCbxs[i].checked) {
_params += "&" + "Car Model ID=" + _allCbxs[i].id;
}
}

alert("The following Boxes are checked:\n\n" + _params);
}



!IBI.FIL.REPORT2;






-HTMLFORM END

This message has been edited. Last edited by: <Kathryn Henning>,


WebFOCUS8
Windows 7
AHTML,Excel,PDF,HTML
January 18, 2014, 10:56 AM
Ram Prasad E
Yes, this you can achieve using Java script. Create on select event on the check box and pass the checkbox value to another fex file which plots the graph.

Thanks,
Ram


WebFOCUS 8.1.05
Windows
http://ibiwebfocus.wordpress.com
https://www.facebook.com/groups/ibi.webfocus/
January 19, 2014, 12:57 PM
j.gross
There is a large difference between a box character, and a check-box control.
January 20, 2014, 09:20 AM
BarryS
Hi Praneeth

Make a drilldow on the checkbox in the procedure that calls a JAVASCRIPT function (parent.function_name). Then you can pass the parameters to the function. The function can then set the controls with the passed parameter and run the graph.

drilldown:
TYPE=REPORT,
column=n1,
JAVASCRIPT=parent.setControls( \
N1 \
N2 \
N3 \
),
$


function setControls(cnty, car, model){

// This is the preferrered method to use
IbComposer_setCurrentSelection('listbox1', cnty, true);
IbComposer_setCurrentSelection('listbox2', car, true);
IbComposer_setCurrentSelection('listbox3', model, false);

IbComposer_execute('report1');
}

Thanks Barry


WebFOCUS 8103, Windows, App Studio
January 21, 2014, 04:58 AM
Kofi
quote:
please provide full code

This is asking someone to do job for you which I think be not correct.

Many helpful hints I have found here but I do not expect anyone to do all code for me.

As you are doing active HTML then the options be there for you so I think you just want to control filtering before graphing. To do this I be looking at what code being generated and try to apply what has been suggest above.

Kofi


Client Server 8.1.05: Apache; Tomcat;Windows Server 2012
Reporting Server 8.1.05; Oracle; MS SQL; Windows Server 2012