Can someone point me in the right direction on allowing the end user to
save query results as an Excel or CSV file on their local machine? I am
using the following code, but it just displays the table on screen, and
does not save the file:

<cfquery name="GetProviderResults"
         datasource="CombinedRaps">
Select Name, Provider, EncounterDate, EncounterMonth,
EncounterYear, SiteID
FROM tblRyan
WHERE Provider = '#SelectedProviderName#'
AND EncounterMonth = '#SelectedServiceMonth#'
AND EncounterYear = '#SelectedServiceYear#'
</cfquery>

<cfheader name="Content-Disposition" value="inline;
filename=ProviderVisits.xls">
<cfcontent type="application/msexcel">

<tr>
<td>Provider</td>
<td>Participant</td>
<td>EncounterDate</td>
<td>EncounterMonth</td>
<td>EncounterYear</td>
<td>SiteID</td>
</tr>
<cfoutput query="GetProviderResults">
<table border="2">
<tr>
<td>#Provider#</td>
<td>#Name#</td>
<td>#EncounterDate#</td>
<td>#EncounterMonth#</td>
<td>#EncounterYear#</td>
<td>#SiteID#</td>
</tr>
</table>
</cfoutput>
[Todays Threads] [This Message] [Subscription] [Fast Unsubscribe] [User Settings] [Donations and Support]

Reply via email to