The i-Technology Media!
Register | Log in
   
 
.NET  ·  AJAX  ·  CLOUD  ·  ECLIPSE  ·  FLEX  ·  OPEN WEB  ·  iPHONE  ·  JAVA  ·  LINUX  ·  OPEN SOURCE  ·  ORACLE  ·  PBDJ  ·  SEARCH  ·  SILVERLIGHT  ·  SOA  ·  VIRTUALIZATION  ·  WEB 2.0  ·  WIRELESS  ·  XML
Comments
Drool, Britannia? Is the UK Failing the Cloud?
By Roger Strukhoff
Richard Davies wrote: The UK has a good crop of technology pioneers in cloud computing - for example ElasticHosts, FlexiScale, Flexiant, OnApp - and also some strong government initiatives such as G-Cloud. We will have to see whether this kind of technical leadership converts into swift mass-market adoption or not.
Jan. 8, 2012 11:38 AM EST
read more & respond »
Cloud Expo on Google News
Did you read today's front page stories & breaking news?

Cloud Expo & Virtualization 2011 West
Keynotes
Oracle
Opening Keynote | An Enterprise Cloud for Business-Critical Applications
Abiquo
Day 2 Keynote | The Enterprise Cloud Tightrope - Balancing for Success
Akamai
Day 3 Keynote | The DNA of an Enterprise Cloud
DIAMOND SPONSOR:
Oracle
Many Clouds, Many Choices'Cloud
PLATINUM PLUS SPONSORS:
Abiquo
Enterprise Cloud Best Practices - Town Hall - Join the discussion…
PLATINUM SPONSORS:
Intel
Progressing Toward the Federated, Automated and Client-Aware Cloud
New Relic
How to build an app with Twitter-like throughput
Rackspace
Computing in the Cloud Era
GOLD SPONSORS:
Gale Technologies
Practical Cloud Migration
IBM
Re-think IT. Re-inventing Business.
Intel/McAfee
Identity Driven Security in the Cloud
PerspecSys
Hackers Hackers Everywhere, Is My Public Cloud That Safe?
Red Hat
Unlock the Value of the Cloud
SHI
Mission Critical Applications and the Cloud - Myth or Reality?
SoftLayer
Not Your Grandpa's Cloud
Terremark
Integrating Enterprise Clouds
VMware
Upgrade to a vCloud
POWER PANELS:
Cloud Expo Silicon Valley: CTO Power Panel
Cloud Expo Silicon Valley: CEO Power Panel
Cloud Expo Silicon Valley: Cloud SuperStars Panel
Cloud Expo Silicon Valley: CloudNOW Panel
Click For 2010 West
Event Webcasts
Cloud Expo & Virtualization 2011 East
DIAMOND SPONSOR:
Dell
Dell & VMware Deliver the Enterprise Hybrid Cloud
PLATINUM PLUS SPONSORS:
Abiquo
Are Financial Services Organizations Risking Security by Avoiding Cloud Computing?
Oracle
From Consolidation to Enterprise Private PaaS
PLATINUM SPONSORS:
Intel
Driving the Transformation to Next Generation Cloud Data Centers
Rackspace
The Inevitability of an Open Cloud
GOLD SPONSORS:
CA Technologies
Follow YOUR path to Cloud Computing
Interxion
Who Keeps the Cloud in the Air?
Microsoft
Patterns for Cloud Computing
PerspecSys
War in the Clouds: Are you ready?
ServiceMesh
The Big Win: Stop Playing Small-Ball with Your Cloud Strategy
Terremark
Evaluating Enterprise Clouds
Xiotech
Cloud Storage: Myths and Realities
POWER PANELS:
Cloud Expo New York: CTO Power Panel
Cloud Expo New York: CEO Power Panel
Cloud Expo New York: CMO Power Panel
Cloud Expo New York: Wrap-Up Power Panel
Click For 2010 West
Event Webcasts
Live Google News by SYS-CON!
Top Three Links You Must Click On


Features
PowerBuilder with FusionCharts
Generating next-generation charts in WebForm applications

By: Bruce Armstrong
Feb. 27, 2009 12:00 PM

Back in August of 2007, I wrote an article entitled "Dynamically Generating Next-Generation Charts from PowerBuilder DataWindows" that demonstrated one method of dynamically generating Flash charts from within a PowerBuilder application. I was primarily writing that from the perspective of writing standard client/server applications. PowerBuilder 11 was just freshly released, and so while the option of creating WebForm applications that incorporated the technology was a factor that was being considered, it wasn't part of the sample at that time.

Fortunately, Haibo Ni of Sybase decided to take that on and came up with an implementation for PowerBuilder .NET WebForm applications. However, Haibo didn't just take my earlier example and create a WebForm target from it. He created his own similar solution based on a different library. I used XML/SWF Charts, a library that I just stumbled across while researching the possibility of generating Flash from PowerBuilder. Haibo used the free version of FusionCharts. FusionCharts is a commercial library, but they make the previous version available for free in order to encourage people to try out their product (and hopefully upgrade to the commercial version). The FusionCharts example as well as my previous XML/SWF Charts example are both available on Sybase's CodeXchange site.

It's hard to do the results justice with simple screenshots because (see Figure 1), as with the XML/SWF Charts sample I did, many of the FusionCharts involve animation. Also similar to the XML/SWF Charts sample, the underlying implementation involves providing an XML file to a Flash library in order to dynamically generate the chart.

But that's also where the similarity ends. With the XML/SWF Chart sample, there was only one Flash library used regardless of the chart type that would eventually be produced. Doing so required a great deal of the chart formatting information to be passed in with the data. That is, the XML file used for XML/SWF contained both formatting and data. Also, if you remember, the data had to be incorporated in the file in a method that was a bit non-native to XML.

With FusionCharts, there is a separate Flash library for each different chart type that is being generated. In addition, formatting information is passed into the library through parameters passed in via the HTML that the Flash library is embedded in (see Listing 1) or via attributes in the first line of the data XML (see Listing 2). As a result, the XML file that is provided contains primarily the data, and in a more normal data format for XML files (see Listing 2). It's also possible to pass the data directly into the library through a dataXML parameter as well, although for all of the examples the data will be passed in via an XML file to the dataURL parameter instead. The samples that Haibo provides also use a JavaScript file to wrap the calls to the Flash library and set the parameters.

So far, this looks fairly straightforward. The main question becomes: "How do you get the chart to display in the WebForm?" When I implemented the XML/SWF Chart sample, I did it for a standard client/server application using the Shockwave ActiveX in a window. However, the WebForm deploy doesn't support ActiveX controls, so some other mechanism must have been used. Even if that did work, that's not the way you'd want to implement it. Most browsers already have a Flash plugin available; you just want to provide the HTML to tell the browser to use that.

The solution is fairly simple, though not obvious. When you deploy an application to WebForms, a property called Embedded becomes available for the StaticHyperLink control. There's some discussion of it in the "Properties for .NET Web Forms" section of the HTML Books documentation for PowerBuilder. Otherwise, you wouldn't know about it. It's not mentioned in the WinHelp file, and the property pane for the control, the system browser, and the AutoScripting feature know nothing of it. When the property is set to true, instead of rendering as a hyperlink, the web page that is referenced is displayed within the IFRAME that is rendered at runtime for the control. Obviously you need to expand the size of the control to accommodate the page.

As a result, the code required to display the chart within the WebForm becomes fairly simple (see Listing 3). The n_cst_fusioncharts object is the object that Haibo created to do the heavy lifting for interacting with the FusionCharts library. In particular, its of_generatehtml_javascript and of_generatedataxml method are the methods used to generate the HTML and XML for the chart, respectively. The embedded property is then set to TRUE for the statichyperlink control and the URL assigned for the HTML page that was generated. The XML file that was generated is referenced within the HTML.

The of_generatehtml_javascript function dynamically generates the HTML based on the type of chart requested and some of its properties (see Listing 4).

The of_generatedataxml function is also worth looking at (see Listing 5). Because it's fairly large, it's only available online.

Regardless, if you're interested in generating next-generation charts in your WebForm applications, you should take a look at what Haibo has provided. The n_cst_fusioncharts object is already architected to do the majority of work for you. You only need to plug it into your application and start using it.

Published Feb. 27, 2009— Reads 4,752
Copyright © 2009 SYS-CON Media, Inc. — All Rights Reserved.
Syndicated stories and blog feeds, all rights reserved by the author.
About Bruce Armstrong
Bruce Armstrong is a development lead with Integrated Data Services (www.get-integrated.com). A charter member of TeamSybase, he has been using PowerBuilder since version 1.0.B. He was a contributing author to SYS-CON's PowerBuilder 4.0 Secrets of the Masters and the editor of SAMs' PowerBuilder 9: Advanced Client/Server Development.

Add Your Feedback

In order to post a comment you need to be registered and logged in.

Register | Sign-in

Reader Feedback: Page 1 of 1

Subscribe to the World's Most Powerful Newsletters
Subscribe to Our Rss Feeds & Get Your SYS-CON News Live!
Click to Add our RSS Feeds to the Service of Your Choice:
Google Reader or Homepage Add to My Yahoo! Subscribe with Bloglines Subscribe in NewsGator Online
myFeedster Add to My AOL Subscribe in Rojo Add 'Hugg' to Newsburst from CNET News.com Kinja Digest View Additional SYS-CON Feeds
Publish Your Article! Please send it to editorial(at)sys-con.com!

Advertise on this site! Contact advertising(at)sys-con.com! 201 802-3021

SYS-CON Featured Whitepapers

ADS BY GOOGLE

Breaking Java News
Relevant Data Names George Schussel Senior Advisor, Strategic Planning; Renowned Data Base Expert Is Advocate of Real-Time Predictive Analytics
Evertz Technologies Limited to Announce Third Quarter 2012 Results on March 6, 2012
Month-End Portfolio Data Now Available for Federated Investors' Closed-End Funds
Western Wind Acheives TSX Venture Top 50 Again for 2012
TABS Group Survey: Organic Food Sales Hit Record in 2011; Sales Jump 15-20 Percent
Telogis is a Highlighted SaaS Provider for the IntelliDriveĀ® Fleet Safety Solutions Program Offered by Travelers
DecisionBase Software Has Received Approval of the First U.S. Patent for a Comprehensive Electronic Clinical Record (EHR) for Dentistry
Rodinia Oil Corp. Announces Statement Concerning Share Price Movement
Three South Florida Business Leaders to Be Honored by NSU
"Fast Company" Names Heritage Provider Network One of the Global 10 Most Innovative Companies in Health Care for 2012

ADVERTISE   |   MAGAZINE SUBSCRIPTIONS   |   FREE BREAKING-NEWSLETTERS!   |   SYS-CON.TV   |   BLOG-N-PLAY!   |   WEBCAST   |   EDUCATION   |   RESEARCH

.NET Developer's Journal - .NETDJ   |   ColdFusion Developer's Journal - CFDJ   |   Eclipse Developer's Journal - EDJ   |   Enterprise Open Source Magazine - EOS
Open Web Developer's Journal - OPENWEB   |   iPhone Developer's Journal - iPHONE   |   Virtualization - Virtualization   |   Java Developer's Journal - JDJ   |   Linux.SYS-CON.com
PowerBuilder Developer's Journal - PBDJ   |   SEO / SEM Journal - SJ   |   SOAWorld Magazine - SOAWM   |   IT Solutions Guide - ITSG   |   Symbian Developer's Journal - SDJ
WebLogic Developer's Journal - WLDJ   |   WebSphere Journal - WJ   |   Wireless Business & Technology - WBT   |   XML-Journal - XMLJ   |   Internet Video - iTV
Flex Developer's Journal - Flex   |   AJAXWorld Magazine - AWM   |   Silverlight Developer's Journal - SLDJ   |   PHP.SYS-CON.com   |   Web 2.0 Journal - WEB2
Apache   |   CMS   |   CRM   |   HP   |   Oracle Journal   |   Perl   |   Python   |   Red Hat   |   Ruby on Rails   |   SAP   |   SaaS

SYS-CON MEDIA:   ABOUT US   |   CONTACT US   |   COMPANY NEWS   |   CAREERS   |   SITE MAP
SYS-CON EVENTS:   |  AJAXWorld Conference & Expo  |  iPhone Developer Summit  |  Cloud Computing Conference & Expo  |  SOA World Conference & Expo  |  Virtualization Conference & Expo
INTERNATIONAL SITES:   India  |  U.K.  |  Canada  |  Germany  |  France  |  Australia  |  Italy  |  Spain  |  Netherlands  |  Brazil  |  Belgium
 Terms of Use & Our Privacy Statement     About Newsfeeds / Video Feeds
Copyright ©1994-2008 SYS-CON Publications, Inc. All Rights Reserved. All marks are trademarks of SYS-CON Media.
Reproduction in whole or in part in any form or medium without express written permission of SYS-CON Publications, Inc. is prohibited.
 
close this window