Focal Point Banner
Community Center Education Summit Technical Support User Groups
Let's Get Social!

Facebook Twitter LinkedIn YouTube
Focal Point    Focal Point Forums  Hop To Forum Categories  WebFOCUS/FOCUS Forum on Focal Point     [CLOSED] Creation of graph based on check box selection
Go
New
Search
Notify
Tools
Reply
  
[CLOSED] Creation of graph based on check box selection
 Login/Join
 
Member
posted
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
 
Posts: 22 | Registered: October 12, 2009Reply With QuoteReport This Post
Master
posted Hide Post
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
 
Posts: 542 | Location: Dearborn, MI | Registered: June 03, 2009Reply With QuoteReport This Post
Virtuoso
posted Hide Post
There is a large difference between a box character, and a check-box control.
 
Posts: 1925 | Location: NYC | In FOCUS since 1983 | Registered: January 11, 2005Reply With QuoteReport This Post
Gold member
posted Hide Post
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
 
Posts: 82 | Location: NYC | Registered: November 13, 2008Reply With QuoteReport This Post
Platinum Member
posted Hide Post
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
 
Posts: 103 | Registered: April 06, 2009Reply With QuoteReport This Post
  Powered by Social Strata  
 

Focal Point    Focal Point Forums  Hop To Forum Categories  WebFOCUS/FOCUS Forum on Focal Point     [CLOSED] Creation of graph based on check box selection

Copyright © 1996-2018 Information Builders, leaders in enterprise business intelligence.