Ask a Question related to Coldfusion Database Access, Design and Development.
-
Aquitaine #1
Exporting query data to Excel - best way?
Hi there,
Something I've had to do a couple of times in the past but that I don't spend
enough time to be a real whiz at is taking a query result and dumping it to raw
text - CSV, tab-delimited, something like that. Historically, I manually wrote
out the new file in CF with the help of chr() and so forth. Needless to say,
'tedium' doesn't begin to describe this.
I now have a couple clients that want to do this more often, all of them using
Excel. In one case, they ultimately need the file in CSV format, but I'm
wondering: is there perhaps a much easier way of doing this? Dumping a CFQUERY
straight to XML and having Excel read that in? Some custom tag/CFC that does
this more smoothly than I have been doing it? What's your favorite
CFQuery-to-downloadable-file mechanism?
Thanks!
Samuel Knowlton
iamsam.org
Aquitaine Guest
-
Exporting to Excel using VB??
Hello: I have an existing MS Access Report built that uses VB to create an Excel spreadsheet.... we are converting over to web-format (CF) and I... -
Exporting to Excel
I'm new to CF, and I am wondering if there is a command or way to create a dynmaic table that depending on what fields are selected those are the... -
Exporting my repeat region data to MS Excel
Hello All, I have a repeat region that shows all the information the users had put in the database, what I want is for them to be able to export... -
Exporting to Excel with Unicode data
Hi I'm trying to get the datagrid to excel export working. I've used the usual code examples that are floating around and it all works fine. The... -
Best way to get ASP page to query Excel data (using SQL server)?
Hi, I plan to query and process some data that resides in an Excel file on a network drive via ASP, with a SQL Server database as a go-between.... -
jdeline #2
Re: Exporting query data to Excel - best way?
Use the code below as a starter kit.
<cfheader name="Content-Disposition" value="inline; filename=acmesalesQ1.xls">
<cfcontent type="application/vnd.msexcel">
<table border="2">
<tr><td>Month</td><td>Quantity</td><td>$ Sales</td></tr>
<tr><td>January</td><td>80</td><td >$245</td></tr>
<tr><td>February</td><td>100</td><td>$699</td></tr>
<tr><td>March</td><td>230</td><td >$2036</td></tr>
<tr><td>Total</td><td>=Sum(B2..B4)</td><td>=Sum(C2..C4)</td></tr>
</table>
jdeline Guest
-
Aquitaine #3
Re: Exporting query data to Excel - best way?
Aha! Wonderful. So simpe. Thank you!
Aquitaine Guest



Reply With Quote

