1 Reply Latest reply on Jul 6, 2006 11:28 AM by amers

    html report or ms excel/csv

    kellyhondalovesmusic Level 1
      Hello i have this code to display query in a html report

      i wish to put another page before this one
      that contains a radio button the has a Html or CSV/excel

      but first how do i output a CSV/excel
      with the same query and html output i have below:

      then i wish to create a page that would have a radio button html or csv/excel


      thanks in advance



      <cfquery name="GetCompanies"
      datasource="#Request.MainDSN#">
      SELECT
      CompanyID,
      CompanyName,
      Address,
      City,
      State,
      ZipCode,
      Comments
      FROM
      Company
      ORDER BY
      CompanyName ASC
      </cfquery>

      <html>
      <head>
      <title>ColdFusion MX Bible</title>
      <link rel="stylesheet" href="styles.css">
      </head>

      <body>

      <h1>Company List</h1>

      <TABLE width=100% align="left" border="4" rules="all">
      <tr>

      <td><b>ID</b></td>
      <td><b>Name</b></td>
      <td><b>Address</b></td>
      <td><b>City</b></td>
      <td><b>State</b></td>
      <td><b>ZIP Code</b></td>
      <td> </td>
      </tr>
      <cfoutput query="GetCompanies">
      <tr>

      <td>#CompanyID#</td>
      <td>#CompanyName#</td>
      <td>#Address#</td>
      <td>#City#</td>
      <td>#State#</td>
      <td>#ZipCode#</td>
      <td>
      <a href="EmployeeList.cfm?CompanyID=#CompanyID#">Employees</a>
      <a href="CompanyAddForm.cfm">Add</a>
      <a href="CompanyEditForm.cfm?CompanyID=#CompanyID#">Edit</a>
      <a href="CompanyDeleteForm.cfm?CompanyID=#CompanyID#">Delete</a>
      </td>
      </tr>
      </cfoutput>
      </TABLE>

      </body>
      </html>