Adobe ColdFusion is a rapid application development platform designed for the simple integration of HTML and ODBC databases. Its markup language closely resembles HTML in syntax and contains many built-in tags that greatly compress the manipulation of records in a database, be it through creation, retrieval, updating, or deletion. One such built-in tag allows you to query a database and dump all or part of the results into an Excel spreadsheet.
Instructions
- 1
Create a new ColdFusion page in your preferred text editor.
2Add the following code, the block HTML output to your spreadsheet:
Add the
SELECT * FROM Employee
4Add the following code beneath the closing tag:
Substitute your preferred filename for Employees.xls.
5Format the output of your query in table form using a
Emp_ID | FirstName | LastName |
Substitute the number that is one higher than the number of variables you are dumping for the value of "cols", your query name for "GetEmps," and the names of the variables for the variables shown in each respective table cell.
6Save and publish your ColdFusion web page and open it in your web browser. Once the page has completely loaded, delete the filename and extension from your address bar and replace it with the filename you supplied for the Excel spreadsheet in Step 4. Hit the "Enter" key and your web browser will access the new spreadsheet you have just created.
0 comments:
Post a Comment