Adding a ComponentOne Chart 2D Control to a Web Page > Step 4: Packaging the Control > B: Creating a .CAB File |
1. Use the cabarc.exe program (found in the Cabinet SDK’s \bin directory) to create .CAB files to combine and compress the files needed for downloading, minimizing the download requirements for the ActiveX controls embedded within your HTML page.
To create a CAB file that contains the ComponentOne Chart 2D OCX, DLL and the .INF file, type:
cabarc n olectra.cab olch2x8.ocx olectra.inf
2. Find the place in the HTML on your Web page where the ComponentOne Chart control is referenced. (There should be an <OBJECT> tag with a CLASSID that matches the 32-bit ComponentOne Chart 2D CLSID. Edit the HTML and add a Codebase element with the suitable web site URL and CAB file name.
For example:
<OBJECT ID="Chart2D" WIDTH=313 HEIGHT=225
CLASSID="CLSID:92D71E93-25A8-11CF-A640-9986B64D9618"
CODEBASE="http://www.yoursite.com/olectra.cab">
</OBJECT>
A Sample HTML File
Here is a very simple .HTML file that displays a 2D chart control. In particular, note the class IDs for the license pack file and the chart control:
<HTML>
<HEAD>
<meta http-equiv="Content-Type"
content="text/html; charset=iso-8859-1">
<TITLE>Home Page</TITLE>
</HEAD>
<OBJECT CLASSID="clsid:5220cb21-c88d-11cf-b347-00aa00a28331"
<PARAM NAME="LPKPath" value="olectra.lpk">
</OBJECT></p>
<p>
<OBJECT ID="Chart2D" WIDTH=313 HEIGHT=225
CLASSID="CLSID:92D71E93-25A8-11CF-A640-9986B64D9618"
CODEBASE="http://www.yoursite.com/olectra.cab">
</OBJECT>
</BODY>
</HTML>