Autodesk 15606-011408-9300 Developer Guide - Page 94
Creating the Report Script
UPC - 606121429548
View all Autodesk 15606-011408-9300 manuals
Add to My Manuals
Save this manual to your list of manuals |
Page 94 highlights
Creating the Report Script Now let's create the ColdFusion template that will process the Autodesk MapGuide report. The following code listing is for the parcel_report.cfm file: ColdFusion Report Data ColdFusion-- ColdFusion query --> SELECT * FROM Parcel_Data Where APN IN (#PreserveSingleQuotes(OBJ_KEYS)#) ColdFusion Report Data Parcel Number: #apn# Owner: #owner# Year Built: #yearblt# Note that CFML tags are almost identical to those in the first example ("Listing File Contents with ColdFusion," on page 89). The only change is to the tag, which uses a different SQL statement: SELECT * FROM Parcel_Data Where APN IN (#PreserveSingleQuotes(OBJ_KEYS)#) As with the previous example, the statement is selecting records from the Parcel_Data DSN. The difference is that the SQL statement now points to a ColdFusion variable, #PreserveSingleQuotes(OBJ_KEYS)#. The OBJ_KEYS values refer to the parameter of the same name we specified in Autodesk MapGuide Author. As its name suggests, the PreserveSingleQuotes function tells ColdFusion to keep the singlequotes surrounding each feature key, instead of removing them automatically as it normally would. The SQL statement is basically saying in Parcel_Data to select all records whose APN field matches OBJ_KEYS. In other words, select the records that correspond to the selected features on the map. If OBJ_KEYS contains multiple keys, ColdFusion outputs the feature data associated with each key. 94 | Chapter 6 Using Reports to Query and Update Data Sources