Download Parallel Crystal Developers Manual
Transcript
Using Parallel Crystal with Active Server Pages
This section describes how to write an Active Server Pages client to generate simple
reports in PostScript, PDF and HTML. The contents apply to ASP 2.0 running under
Microsoft's IIS 4.0 Web Server.
Active Server Pages is a web development technology that allows HTML pages to be
composed dynamically using a scripting engine that executes inside the IIS Web Server.
Pages on the Web Server with .asp suffixes contain standard HTML tags interleaved with
embedded scripts that are written in a simplified version of Visual Basic called VBScript.
The reply page delivered to the Web Browser consists of the original HTML combined
with the results of executing the scripts. For example, a very simple ASP page that returns
the date and time on the Web Server, might take the following form:
<HTML>
<HEAD>
<TITLE>Remote Time</TITLE>
</HEAD>
<BODY>
You visited me on <% = Date %> at <% = Time %>
</BODY>
</HTML>
In this fragment, the VBScript interpreter replaces the text between the <% and %>
delimiters by date and time strings, before returning the HTML page to the Web Brower.
Multi-line scripts can be formed by locating the <% and %> brackets on separate lines, or by
using <SCRIPT> and </SCRIPT> HTML tags:
<SCRIPT LANGUAGE="VBScript" RUNAT="Server">
...
</SCRIPT>
The attributes are necessary to identify VBScript as the scripting language, and to
distinguish server-side scripts that run in the Web Server, from client-side scripts that run
in the Web Browser. The <% and %> provide a more concise way of specifying server
scripts, and we use them throughout the examples in this section.
In addition to the ability to generate HTML dynamically, server-side scripts can connect to
any ActiveX Automation Server that is registered on the web server. In particular, an ASP
page can connect to the PCRE Automation Server with a script such as:
<%
Dim app
Set app = Server.CreateObject("MAS.CRApplication.1")
...
Set app = Nothing
%>
Parallel Crystal Developer's Manual
Version 2.4 - Revised 5/27/00
162