CF7 – Creare un file excel
Posto questa interessante pagina di macromedia che spiega come generare un file excel partendo da una visualizzazione html di una query.
Per completezza riporto anche il codice:
<cfsetting enablecfoutputonly="Yes">
<!— Get employee info. —>
<cfquery name="GetEmps" datasource="cfdocexamples">
SELECT * FROM Employee
</cfquery>
<!— Set content type. —>
<cfcontent type="application/msexcel">
<!— Suggest default name for XLS file. —>
<!— "Content-Disposition" in cfheader also ensures
relatively correct Internet Explorer behavior. —>
<cfheader name="Content-Disposition" value="filename=Employees.xls">
<!— Format data using cfoutput and a table.
Excel converts the table to a spreadsheet.
The cfoutput tags around the table tags force output of the HTML when
using cfsetting enablecfoutputonly="Yes" —>
<cfoutput>
<table cols="4">
<cfloop query="GetEmps">
<tr>
<td>#Emp_ID#</td>
<td>#FirstName#</td>
<td>#LastName#</td>
</tr>
</cfloop>
</table>
</cfoutput>
Approfondimenti online
La tecnologia informatica ha fatto passi da gigante. In modo particolare Google, che con il suo analizzatore di testo, è in grado di proporre collegamenti contestuali a quanto hai appena letto. Questi i link pubblicitari proposti da Adsense.









Le ultime al bancone