|
Home / Column
Articles/ June
2003 Column Article
June 2003 Column Article
Embedding Graphics Server .NET Windows Form Chart Control into Internet
Explorer
By Herry Lesmana
Graphics Server .NET includes two controls to use when programming:
GSNetWinChart and GSNetWebChart. GSNetWebChart is the standard way to implement
charts for ASP.NET web pages, while GSNetWinChart is the standard chart
implementation for Windows Forms applications. Both GSNetWinChart and
GSNetWebChart can be displayed in Internet Explorer (IE), similar to a lot of
controls that you may have seen while browsing web pages. Multimedia players
and java applets are among the very common controls you see in web pages. There
are of course tradeoffs between using GSNetWinChart and GSNetWebChart in your
web applications.
One of the advantages using GSNetWinChart embedded into IE is that your clients
will now have more power and flexibility controlling their charts. This
includes customizing their charts' properties by opening property pages and
property window. Loading charts on the clients' machines will be faster using
the GSNetWinChart control, rather than the GSNetWebChart control, since
GSNetWinChart doesn't require downloading a new image file each time the chart
changes. However, the clients' machines will require a one-time initial
download of the GSNetWebChart control, and optionally the .NET framework if not
already installed.
The downside is that your clients will need to download a new Graphics Server
assembly every time there is a version change. Plus, each client viewing charts
will need the .NET framework installed on their local machine. Since
downloading and running the assembly take place over the Internet, security
issues also arise. Each of your clients will be required to setup their .NET
security configuration to allow downloading and running the assembly. It is
very desirable that your company has its own security policy between your
server and your clients, and you conform to this policy when setting up .NET
security. The GSNetWebChart is favorable when considering security issues since
it requires a minimum amount of security setup on the server, and no security
setup on the client machines. But, your server would need to have the .NET
framework and Graphics Server assembly installed. With GSNetWebChart, charts
will be returned to your clients as images instead of controls. This gives up
the power and flexibility to control the charts at run time. The following
figures illustrate a simple application using GSNetWinChart:
* Figure 1 - a simple application using GSNetWinChart
* Figure 2 - context menu item by right clicking
* Figure 3 - chart property window
* Figure 4 - chart property pages
The sample source code:
<!-- WinChart.html -->
<!-- a "GSNetWinChart embedded in IE" example -->
<html>
<title> GSNetWinChart embedded in IE </title>
<body>
<object id="myChart" style="width: 700px; height: 400px; border-width: 1px;
border-style: solid"
classid="Path/GSNetWin.dll#GraphicsServer.GSNet.Charting.GSNetWinChart"
VIEWASTEXT>
</object>
</body>
</html>
* The "Path/" in the object tag's classid can be an absolute path such as
"http://myserverurl/" or a relative one for instance you can use "./" if you
put GSNetWin.dll in the same directory as WinChart.html.
For more information about this sample application, and information on setting
up the security to run the sample, go to Graphics Server knowledge base article
GSKB304.
|