Creating Report Scripts with ASP
|
117
When a user selects one or more features from the Assessment layer and runs
the Parcel Data (ASP) report, Autodesk MapGuide constructs a URL that
invokes
parcel_report.asp
and tells it to generate a report on the selected
features, which are identified by their OBJ_KEY
values. If the user selected a
single feature whose key was 941-0176-003-00, the URL would look like this:
http://www.yourserver.com/asp/parcel_report.asp?OBJ_KEYS='941-
0176-003-00'
If the user selected multiple features, the URL might look like this:
http://www.yourserver.com/asp
parcel_report.asp?OBJ_KEYS='941-0176-003-00','941-0176-006-00','941-0176-004-00'
Note that
OBJ_KEYS
is represented as a standard URL parameter. To ASP, this
parameter is no different from one submitted by an HTML form element. As
we’ll see in the next section, ASP processes it accordingly.
Creating the Report Script
Now let’s create the ASP file that will process the Autodesk MapGuide report.
The following code listing is for the
parcel_report.asp
file:
<HTML>
<HEAD>
<TITLE>ASP Report Data</TITLE>
</HEAD>
<BODY>
<!-- code to create recordset -->
<%
Set dbConnection = Server.CreateObject("ADODB.Connection")
dbConnection.Open ("assessor")
SQLQuery = "SELECT * FROM Parcel_Data Where APN IN (" & Request.Form ("OBJ_KEYS") & ")"
Set RS = dbConnection.Execute(SQLQuery)
%>
<H1>ASP Report Data</H1>
<!-- output code -->
<%
Do While Not RS.EOF
%>
<P>Parcel Number: <%=RS("APN")%><BR>
Owner: <%=RS("Owner")%><BR>
Year Built: <%=RS("yearblt")%></P>
<%
RS.MoveNext
Loop
%>
</BODY>
</HTML>
Note that the VBScript code is almost identical to that in the first example
(“Listing File Contents with ASP” on page 111). The only change is to the
value we assign the
SQLQuery
variable.
Summary of Contents for 15606-011408-9300 - MAP R6.3 UPG
Page 1: ...15306 010000 5060 October 2001 Autodesk MapGuide Release 6 Developer s Guide ...
Page 6: ...vi ...
Page 16: ...16 ...
Page 30: ...30 ...
Page 84: ...84 ...
Page 134: ...134 ...
Page 202: ...202 ...