IB - Developer Center    Forums  Hop To Forum Categories  FOCUS/WebFOCUS    Accordian Expandable on lower BY
Go
New
Search
Notify
Tools
Reply
  
-star Rating Rate It!  Login/Join 
Member
Posted
Hello,

I wanted to check if anyone has done accordian report expandable on lower level by phrase, so that users can see first level by fields but click to get data for lower level BY phrase.

TABLE FILE CAR
SUM DC RC
BY COUNTRY
BY CAR
BY MODEL
ON CAR SET SET EXPANDABLE ON
END

Is there any other way to achive this by any other technique if not ACCORDIAN?


Thanks,

YA
 
Posts: 18 | Location: Allstate Insurance Co. | Registered: January 25, 2005Reply With QuoteEdit or Delete MessageReport This Post
Master
Posted Hide Post
This technique uses a little bit of javascript to expand a number of columns when you run the table request, so you can open the first n columns and then expand from the n+1 by field. this is a smaple table request, the define and the reference to the define in the subfoot are required:

   
SET STYLEMODE=PAGED
DEFINE FILE CAR
callJS/A240 = '<script src="../../tests/test27.js" type="text/javascript"></script>' |
              '<script>window.onload=clickItemsOpen;var columnsToOpen=2;</script>';
END
TABLE FILE CAR
ON TABLE SUBFOOT
"<callJS"
PRINT
     SALES RCOST DCOST 
BY COUNTRY
BY CAR
BY MODEL
BY BODYTYPE
ON TABLE SET PAGE-NUM OFF
ON TABLE SET EXPANDABLE ON
ON TABLE NOTOTAL
ON TABLE PCHOLD FORMAT HTML
ON TABLE SET HTMLCSS ON
ON TABLE SET STYLE *
     UNITS=IN,
     LEFTMARGIN=0.250000,
     RIGHTMARGIN=0.250000,
     TOPMARGIN=0.250000,
     BOTTOMMARGIN=0.250000,
     SQUEEZE=ON,
     ORIENTATION=PORTRAIT,
$
TYPE=REPORT,
     FONT='ARIAL',
     SIZE=10,
     COLOR='BLACK',
     BACKCOLOR='NONE',
     STYLE=NORMAL,
     RIGHTGAP=0.125000,
$
TYPE=DATA,
     SIZE=8,
     BACKCOLOR=( RGB(234 234 255) 'WHITE' ),
$
TYPE=TITLE,
     BORDER=LIGHT,
     BORDER-STYLE=RIDGE,
     BORDER-COLOR=RGB(51 51 153),
     SIZE=9,
     COLOR='WHITE',
     BACKCOLOR=RGB(147 172 219),
     STYLE=BOLD,
$
TYPE=TABHEADING,
     SIZE=9,
     STYLE=BOLD,
$
TYPE=TABFOOTING,
     SIZE=9,
     STYLE=BOLD,
$
TYPE=HEADING,
     BORDER=LIGHT,
     BORDER-STYLE=RIDGE,
     BORDER-COLOR=RGB(51 51 153),
     SIZE=12,
     COLOR='WHITE',
     BACKCOLOR=RGB(147 172 219),
     STYLE=BOLD,
     JUSTIFY=CENTER,
$
TYPE=HEADING,
     LINE=1,
     SIZE=14,
$
TYPE=FOOTING,
     BORDER=LIGHT,
     BORDER-STYLE=RIDGE,
     BORDER-COLOR=RGB(51 51 153),
     COLOR='WHITE',
     BACKCOLOR=RGB(147 172 219),
     STYLE=BOLD,
$
TYPE=SUBHEAD,
     SIZE=9,
     STYLE=BOLD,
$
TYPE=SUBFOOT,
     BORDER=LIGHT,
     BORDER-STYLE=RIDGE,
     BORDER-COLOR=RGB(51 51 153),
     SIZE=9,
     COLOR='WHITE',
     BACKCOLOR=RGB(147 172 219),
     STYLE=BOLD,
$
TYPE=SUBTOTAL,
     SIZE=8,
     STYLE=BOLD,
$
TYPE=ACROSSVALUE,
     SIZE=8,
     STYLE=BOLD,
$
TYPE=ACROSSTITLE,
     SIZE=8,
     STYLE=BOLD,
$
TYPE=GRANDTOTAL,
     SIZE=9,
     STYLE=BOLD,
$
ENDSTYLE
END



The javascript file, in this case called test27.js, save to a place that is referenced in thescript src in the define:

  
function clickItemsOpen(){
var i=0;var s='';var t='';var u='';
// Get an array of all the td tags in the document.
var allTD = document.getElementsByTagName("td");
// How many td tags are there
var numTD = allTD.length;
// Loop through all the td tags
for (i=0;i<numTD-1;++i) {
// First of 3 checks - if the td tag doesn't have an image, go to next iteration
  if (allTD[i].getElementsByTagName("img").length == 0) continue;
// Second of 3 checks - if there is no attribute called ibiattr in the td, go to next iteration
  if (allTD[i].getAttribute("ibiattr") == 0) continue;
// Third of 3 checks - if the attribute called ibiattrc in the td has a value greater than the 
// column to expand, go to next iteration
  if (allTD[i].getAttribute("ibiattrc") > columnsToOpen) continue;
// get the a tag within the td
  s=allTD[i].getElementsByTagName("a");
// get the href within the a tag  
  t=s[0].getAttribute("href");
// substring the href to get the call to the function
  u=t.substring(11,t.length);
// use eval to call the function  
  eval(u)
// remove the link to stop user contracting the report  
  allTD[i].removeChild(s[0]);
  }
// border.collapse causes issues on Firefox
if(navigator.userAgent.indexOf("Firefox")!=-1) document.getElementsByTagName("table")[0].style.borderCollapse="separate";  
}



In the DEFINE in the table request, change the value of columnsToOpen to be what you want.

This should work for any accordian report, and maybe give you the layout you want.


Alan.
WF 7.6.5, PMF 5.1, MRE,RA,RG, etc... Win2003(8xQuad)/IIS/Tomcat with SSL and AD security.
 
Posts: 848 | Location: Portugal | Registered: February 07, 2007Reply With QuoteEdit or Delete MessageReport This Post
Virtuoso
Posted Hide Post
a search on this site will show you some more interesting suggestions on this subject Yogi

Frank




Frank

prod: WF 7.6.5 platform Windows,
databases: msSQL2000, msSQL2005, RMS, Oracle, Sybase,IE7
test: WF 7.6.5 on the same platform and databases,IE7

 
Posts: 1644 | Location: Amsterdam, the Netherlands | Registered: December 03, 2006Reply With QuoteEdit or Delete MessageReport This Post
Member
Posted Hide Post
Thanks Alan and Frank. I am going to try suggestions right away.
:-)
 
Posts: 18 | Location: Allstate Insurance Co. | Registered: January 25, 2005Reply With QuoteEdit or Delete MessageReport This Post
Member
Posted Hide Post
Alan
Suggestion worked very well. Thanks for the valuable info.
 
Posts: 18 | Location: Allstate Insurance Co. | Registered: January 25, 2005Reply With QuoteEdit or Delete MessageReport This Post
 Previous Topic | Next Topic powered by eve community  
 

IB - Developer Center    Forums  Hop To Forum Categories  FOCUS/WebFOCUS    Accordian Expandable on lower BY

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