Focal Point
Select Muliple Rows for drilldown

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

March 19, 2008, 12:09 PM
<dksib>
Select Muliple Rows for drilldown
I require a javascript that allows me to select multiple rows (by checkbox) and then execute a drilldown from multiple reports.

Does anyone have one that I can clone?

Thanks in advance.
March 19, 2008, 12:42 PM
Darin Lee
The problem is that "multiple rows" indicates a report, but "checkbox" indicates some sort of form. How are you going to get each row of a report to appear with a checkbox in a form. And, because WF doesn't provide a way for multi-selecting "rows" and performing a drill-down, you've got a tough (if not impossible) row to hoe with this one - even with Javascript.

I would go with some form of multi-drill functionality where multiple reports/parm sets can be run from a single row instead of one report being run for multiple rows. I know that's not your specific requirement, but it may be some sort of answer to a tough question.


Regards,

Darin



In FOCUS since 1991
WF Server: 7.7.04 on Linux and Z/OS, ReportCaster, Self-Service, MRE, Java, Flex
Data: DB2/UDB, Adabas, SQL Server Output: HTML,PDF,EXL2K/07, PS, AHTML, Flex
WF Client: 77 on Linux w/Tomcat
March 19, 2008, 12:50 PM
<dksib>
I will be creating a HTML report with a checkbox in front of the row. I was thinking of somehow counting the rows (i) and using the values required from the rows that were checked.

David
March 20, 2008, 03:48 AM
Tony A
David,

Here's something you can play with.
APP PREPENDPATH IBISAMP
TABLE FILE CAR
PRINT COMPUTE CTRY_CNT/P2   = IF COUNTRY EQ LAST COUNTRY THEN LAST CTRY_CNT ELSE CTRY_CNT + 1; NOPRINT
      COMPUTE CTRY_INP/A100 = '<input type="checkbox" id="CTRY'||EDIT(CTRY_CNT)||'" name="CTRY" value="'
                   ||COUNTRY||'" onClick="check_click(''CTRY'||EDIT(CTRY_CNT)||''');">'; AS ''
BY COUNTRY AS ''
ON TABLE HOLD AS MYHTML FORMAT HTMTABLE
ON TABLE SET HTMLCSS ON
ON TABLE SET PAGE NOLEAD
ON TABLE SET STYLE *
  GRID=OFF, SIZE=9, $
  TYPE=DATA, COLUMN=COUNTRY, CLASS=ctry_style, $
  TYPE=DATA, COLUMN=CTRY_INP, CLASS=chck_style, $
ENDSTYLE
END
-RUN
-HTMLFORM BEGIN
<html>
<head>
<title>Multi Checkboxes</title>
<style>
  .ctry_style {width:200px;}
  .chck_style {width:25px;}
</style>
<script language=javascript>
function check_click(ctry) {
// Perform anything you need within this function
  if (document.getElementById(ctry).checked) {
// control is checked
    alert("You have selected "+document.getElementById(ctry).value);
  } else {
// control is unchecked
  }
//  alert("You have selected "+document.getElementById(ctry).value);
}
function select_all() {
  SelAll = document.getElementById("SELALL");
  Countries = document.getElementsByName("CTRY");
  for (i=0;i<Countries.length;i++) {
    Country = Countries[i];
    Country.checked = SelAll.checked;
  }
}
function submit_form() {
// Here you can validate the form. Such as to ensure at least one country is clicked etc.
  Countries = document.getElementsByName("CTRY");
  var ctry_cnt = 0;
  for (i=0;i<Countries.length;i++) {
    Country = Countries[i];
    ctry_cnt += Country.checked;
  }
  if (ctry_cnt > 0) {
    document.form.target = "_blank";
    generate_random();
    document.form.submit();
  } else {
    alert("You must select at least one Country");
  }
}
function generate_random() {
  var Random_No = Math.floor(Math.random()*100000);
  Rand = document.getElementById("IBIMR_random");
  Rand.value = Random_No;
}
</script>
</head>
<body>
<form name="form" method="get" action="/ibi_apps/WFServlet">
<input type=hidden name="IBIF_ex" id="IBIF_ex" value="fexname.fex">
<input type=hidden name="IBIAPP_app" id="IBIAPP_app" value="appfolder">
<!-- MRE / BID Version variables
<input type=hidden name="IBIMR_action" value="MR_RUN_FEX">
<input type=hidden name="IBIMR_sub_action" value="MR_STD_REPORT">
<input type=hidden name="IBIMR_domain" value="xxxxxxxx/xxxxxxxx.htm">
<input type=hidden name="IBIMR_folder" value="#xxxxxxxxxxxx">
<input type=hidden name="IBIMR_fex" value="app/fexname.fex">
-->
<!-- Common variables -->
<!-- This turns off amper autoprompting -->
<input type=hidden name="WF_DESCRIBE" id="WF_DESCRIBE" value="OFF">
<!-- this should avoid caching problems -->
<input type=hidden name="IBIMR_random" id="IBIMR_random" value=0>
!IBI.FIL.MYHTML;
<table cellpadding=1 class='x1'>
<tr>
<td class='ctry_style' style="background-color:#ccccff;">
Select All</td>
<td class='chck_style'>
<input type="checkbox" id="SELALL" value="ALL" onClick="select_all();"></td>
</tr>
<tr>
</table>
<input id=btn_submit style="position:relative; top:10px; left:70px; width:38px; height:22px;
 background-color:#f0f5ff; background-image:url(/ibi_html/javaassist/ibi/html/describe/run16.gif);"
 type="button" value=" " onClick="submit_form();">
<input id=btn_reset style="position:relative; top:10px; left:80px; width:38px; height:22px;
 background-color:#f0f5ff; background-image:url(/ibi_html/javaassist/ibi/html/describe/reset.gif);"
 type="reset" value=" ">
</form>
</body>
</html>
-HTMLFORM END

T

This message has been edited. Last edited by: Tony A,



In FOCUS
since 1986
WebFOCUS Server 8.2.01M, thru 8.2.07 on Windows Svr 2008 R2  
WebFOCUS App Studio 8.2.06 standalone on Windows 10 
March 25, 2008, 08:50 AM
<dksib>
Thanks