Focal Point
[SHARING] Question for the Style Gurus

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

February 24, 2012, 04:00 PM
Dan Pinault
[SHARING] Question for the Style Gurus
Hi all,

We've had a request to create an application that creates an org-chart-like output. It would consist of 'boxes' representing various entities and lines connecting the boxes with labels specific to the type of relationship.

Anybody out there done something like this in WebFOCUS or Flex Enable? This is my preferred method. Visio or Visio/SharePoint would be my second choice.

Thanks!

Dan

This message has been edited. Last edited by: Kerry,


7.7.05M/7.7.03 HF6 on Windows Server 2003 SP2 output to whatever is required.
February 25, 2012, 09:46 PM
njsden
I have a similar need and had initially discarded WebFOCUS for such a task though it would be the perfect tool for us as it's the one platform with secured access to the underlying data in our shop. No further research has been done yet but it will have to be restarted soon.

quote:
Visio or Visio/SharePoint would be my second choice

As I don't have much (or any actually) experience with Visio or Sharepoint I'd like to ask how you would achieve what you need with either tool? Do they provide some kind of API or other programming interface that would allow for the creation of those charts with their content and hierarchy configuration driven by a database?



Prod/Dev: WF Server 8008/Win 2008 - WF Client 8008/Win 2008 - Dev. Studio: 8008/Windows 7 - DBMS: Oracle 11g Rel 2
Test: Dev. Studio 8008 /Windows 7 (Local) Output:HTML, EXL2K.
February 26, 2012, 03:53 PM
Waz
How big could this chart be (width and height) ?

And how would it be represented (Top down, Left to Right, other) ?


Waz...

Prod:WebFOCUS 7.6.10/8.1.04Upgrade:WebFOCUS 8.2.07OS:LinuxOutputs:HTML, PDF, Excel, PPT
In Focus since 1984
Pity the lost knowledge of an old programmer!

February 26, 2012, 05:34 PM
Dan Pinault
njsden - I don't have any experience with Visio either so I'd have to learn how to get this done (if that is the path we take). My thinking is that there must be a way via the Visio SDK to trigger an update and then re-save for the web. If that is true we'll build a simple Maintain app for them to modify the data and then we'll figure out how to call the Visio commands via an update button. That is literally as far as I have gotten on this. Here is a link to the Visio 2010 SDK Documentation

Waz - I'm not really sure how big the chart could get. The samples I have were printed on letter size paper though and there was plenty of white space. I'm hoping to keep the orientation in one direction. Top down would minimize any left-right scrolling.


7.7.05M/7.7.03 HF6 on Windows Server 2003 SP2 output to whatever is required.
February 26, 2012, 05:42 PM
Waz
Also what format ?


Waz...

Prod:WebFOCUS 7.6.10/8.1.04Upgrade:WebFOCUS 8.2.07OS:LinuxOutputs:HTML, PDF, Excel, PPT
In Focus since 1984
Pity the lost knowledge of an old programmer!

March 01, 2012, 07:56 AM
Dan Pinault
Most likely the format will be HTML but I suppose it will depend on how we create it. If I do it with WebFOCUS then I'll prolly give the user some output options.
Otherwise, the Visio option has an ActiveX control for viewing the diagram. Depending on how much functionality that has I might just skip it though as many of our customers won't allow the use of ActiveX.

Sooooo, unless somebody from IBI has any ideas it looks like I may need to use a different product to get this done! Music hint, hint, nudge, nudge...


7.7.05M/7.7.03 HF6 on Windows Server 2003 SP2 output to whatever is required.
March 01, 2012, 03:46 PM
Waz
I have an idea that may work, well sevaral ideas.

For HTML, there is probably some sort of org chart code in javascript out there, so its just a case of generating the input to it.

For PDF, I think I could write something that will do it, but its all conceptual.


Waz...

Prod:WebFOCUS 7.6.10/8.1.04Upgrade:WebFOCUS 8.2.07OS:LinuxOutputs:HTML, PDF, Excel, PPT
In Focus since 1984
Pity the lost knowledge of an old programmer!

March 01, 2012, 03:50 PM
Waz
Two HTML based org charts.

http://code.google.com/apis/ch...allery/orgchart.html

http://thejit.org/


Waz...

Prod:WebFOCUS 7.6.10/8.1.04Upgrade:WebFOCUS 8.2.07OS:LinuxOutputs:HTML, PDF, Excel, PPT
In Focus since 1984
Pity the lost knowledge of an old programmer!

March 02, 2012, 09:50 AM
njsden
I was doing some work on this during the past 2 days and managed to create something using jquery-OrgChart, a plugin for my favourite JavaScript utility: jQuery.

One limitation I'm currently facing with that plugin is that all nodes display in a horizontal orientation so when a parent node has many "children" they all display on a loooooong single horizontal sequence and the required scrolling is quite annoying.

I'll keep on the look for options that allow a vertical orientation (on demand).



Prod/Dev: WF Server 8008/Win 2008 - WF Client 8008/Win 2008 - Dev. Studio: 8008/Windows 7 - DBMS: Oracle 11g Rel 2
Test: Dev. Studio 8008 /Windows 7 (Local) Output:HTML, EXL2K.
March 02, 2012, 09:56 AM
Danny-SRL
Following Wax... and using the google code he suggested, I came up with this:
  
-SET &ECHO=ALL;
-* File ORG01.fex
SET HOLDLIST=PRINTONLY
DEFINE FILE CAR
T/A100='["Car File", "" , ""]';
END
TABLE FILE CAR
PRINT T
COUNTRY NOPRINT
IF RECORDLIMIT EQ 1
ON TABLE HOLD FORMAT ALPHA
END
-RUN
FILEDEF HOLD DISK HOLD.FTM (APPEND
-RUN
DEFINE FILE CAR
T/A100 ='["' | (COUNTRY || '", "Car File", "Country"]');
L1/A100 = '["' || (CAR || '", "') || (COUNTRY || '", "Company"]');
L2/A100 = '["' || (BODYTYPE || '-' || CAR || '", "') || (CAR || '", "Type"]');
END
TABLE FILE CAR
SUM T
BY COUNTRY NOPRINT
ON TABLE SAVE AS HOLD
END
-RUN
-SET &N=&LINES + 1;
TABLE FILE CAR
SUM L1
BY COUNTRY NOPRINT
BY CAR NOPRINT
ON TABLE SAVE AS HOLD
END
-RUN
-SET &N=&N + &LINES;
TABLE FILE CAR
SUM L2
BY COUNTRY NOPRINT
BY CAR NOPRINT
BY BODY NOPRINT
ON TABLE SAVE AS HOLD
END
-RUN
-SET &N=&N + &LINES;
FILEDEF CHART DISK CHART.FEX
TABLE FILE HOLD
PRINT 
COMPUTE LL/I3=LL + 1; NOPRINT
COMPUTE LT/A101=IF LL LT &N THEN T || ',' ELSE T;
ON TABLE SAVE AS CHART
END
-RUN
-HTMLFORM BEGIN
<html>   
 <head>     
  <script type='text/javascript' src='https://www.google.com/jsapi'></script>     
  <script type='text/javascript'>       
     google.load('visualization', '1', {packages:['orgchart']});       
	 google.setOnLoadCallback(drawChart);       
	 function drawChart() {         
	      var data = new google.visualization.DataTable();         
		  data.addColumn('string', 'Name');         
		  data.addColumn('string', 'Manager');         
		  data.addColumn('string', 'ToolTip');         
		  data.addRows([           
-INCLUDE CHART
		  ]);         
	      var chart = new google.visualization.OrgChart(document.getElementById('chart_div'));         
	      chart.draw(data, {allowHtml:true});       
	 }     
  </script>   
 </head>    
 <body>     
   <div id='chart_div'></div>   
 </body> 
</html>
-HTMLFORM END



Daniel
In Focus since 1982
wf 8.202M/Win10/IIS/SSA - WrapApp Front End for WF

March 02, 2012, 10:01 AM
njsden
Thanks Danny. I had taken a quick look at Google's OrgChart but did not find it being able to display nodes vertically either. The charts look very professional though!

I will also need to validate if they would allow us to host the API directly in our servers (not always requires a "live" internet connection for this to work) and personally got a bit concerned about their "terms" as they reserve the right to push publicity/advertisement as part of the results of using their API's and that is something we would not like for our solution. I know, it's free but ...

Your sample code works great though! I think I'll borrow some of it for my own internal testing Big Grin

This message has been edited. Last edited by: njsden,



Prod/Dev: WF Server 8008/Win 2008 - WF Client 8008/Win 2008 - Dev. Studio: 8008/Windows 7 - DBMS: Oracle 11g Rel 2
Test: Dev. Studio 8008 /Windows 7 (Local) Output:HTML, EXL2K.
March 02, 2012, 12:31 PM
j.gross
Daniel --

Really nice.

Note: On IE9, I got the "Internet Explorer has modified this page to help prevent cross-site scripting" message; had to "disable XSS filter" to allow the output to be rendered.


- Jack Gross
WF through 8.1.05
March 03, 2012, 11:27 AM
Danny-SRL
Hi Jack,

Thanks for your comments.
You said:
quote:
Note: On IE9, I got the "Internet Explorer has modified this page to help prevent cross-site scripting" message; had to "disable XSS filter" to allow the output to be rendered.

I have a similar problem with IE8. Do you konw what is the equivalent of "disable XSS filter" in IE8?


Daniel
In Focus since 1982
wf 8.202M/Win10/IIS/SSA - WrapApp Front End for WF

March 03, 2012, 04:50 PM
njsden
quote:
I have a similar problem with IE8


Interesting ... I'm also using IE 8 and don't recall getting that XSS filter message. I'll take a look to see what I have in there.



Prod/Dev: WF Server 8008/Win 2008 - WF Client 8008/Win 2008 - Dev. Studio: 8008/Windows 7 - DBMS: Oracle 11g Rel 2
Test: Dev. Studio 8008 /Windows 7 (Local) Output:HTML, EXL2K.
March 03, 2012, 05:19 PM
njsden
Danny, I do have "Enable XSS Filtering" in IE8 enabled and yet your code worked nicely without IE prompting me anything Confused

Anyway, you can go to:

Tools > Internet Options > Security > Custom level ...

Scroll to the bottom of the list of options. You will find "Enable XSS filter" at the second last entry right above "User Authentication".

This message has been edited. Last edited by: njsden,



Prod/Dev: WF Server 8008/Win 2008 - WF Client 8008/Win 2008 - Dev. Studio: 8008/Windows 7 - DBMS: Oracle 11g Rel 2
Test: Dev. Studio 8008 /Windows 7 (Local) Output:HTML, EXL2K.
March 04, 2012, 12:36 AM
Danny-SRL
Strange: Before changing the XSS to disable, in DS, when I run a fex from the editor I get the "scripting" message and the report is blocked. However, when I run from the DS explorer it works fine.
After disabling, I get output in both cases.
Thanks for the tip.


Daniel
In Focus since 1982
wf 8.202M/Win10/IIS/SSA - WrapApp Front End for WF

March 05, 2012, 01:45 PM
Dan Pinault
Hey, this is awesome! Lots of great ideas here. I'll give these a try and post an example of whatever we come up with.

Thanks everyone Smiler

Dan


7.7.05M/7.7.03 HF6 on Windows Server 2003 SP2 output to whatever is required.
May 26, 2014, 06:12 PM
Waz
Yes, very nice, spurs the imagination....


Waz...

Prod:WebFOCUS 7.6.10/8.1.04Upgrade:WebFOCUS 8.2.07OS:LinuxOutputs:HTML, PDF, Excel, PPT
In Focus since 1984
Pity the lost knowledge of an old programmer!