Ask a Question related to Coldfusion Database Access, Design and Development.
-
fluiter #1
collumm names from DB to Excel
I manage to download data fields from the Database in to an Excel file. Now i
would like to have the collomm names downloaded as well. Here is the code i'm
currently having. I <cfquery name='laden' datasource='issue'> SELECT * FROM
tbl_issue ORDER BY issue_number ASC </cfquery> <!--- set vars for special
chars ---> <cfset TabChar = Chr(9)> <cfset NewLine = Chr(13) & Chr(10)>
<!--- set content type to invoke Excel ---> <cfcontent
type='application/msexcel'> <!--- suggest default name for XLS file ---> <!---
use 'Content-Disposition' in cfheader for Internet Explorer ---> <cfheader
name='Content-Disposition' value='filename=issue.xls'> <!--- output data using
cfloop & cfoutput ---> <cfloop query='laden'>
<cfoutput>#laden.issue_number##TabChar##laden.inte rnal_nr##TabChar##laden.region
##TabChar##laden.channel##TabChar##laden.issue_typ e##TabChar##laden.vendor##TabC
har##laden.carrier##TabChar##laden.qrb_cat##TabCha r##laden.customer_impact##NewL
ine#</cfoutput> </cfloop>
fluiter Guest
-
Place Excel into table with ability to link when native Excel file is updated.
Is it possible to place an Excel file into InDesign and create a link so that any changes made later to the Excel file can be updated in InDesign? ... -
[PHP-DEV] Method Names
It seems that PHP 5 treats all methods as lower case, so that text() is Text(). Is this going to remain this way? -- PHP Internals - PHP Runtime... -
Machine names v. User names
Good Morning... Unfortunately one of our mainframe processes require a local machine name that is identical to the local user account name. For... -
[PHP] PHP, Excel, jpgraph - can the graph be included in the Excel output?
You need a class that can create xls files with images. Or you can create a Web Archive: http://officeupdate.microsoft.com/office/webarchive.htm ... -
PHP, Excel, jpgraph - can the graph be included in the Excel output?
Good morning! I have several reports that are generated using PHP & MySQL for which I would like to include a graph using the excellent jpgraph... -
VillageX #2
Re: collumm names from DB to Excel
Since you have the field names in your code, the easiest thing you can do is to just type them in your code right above the start of your CFLOOP.
VillageX Guest
-
philh #3
Re: collumm names from DB to Excel
If you narrow the columns in the SELECT statement to exactly what you need for
the output (instead of *), you can include this code before the CFLOOP:
<cfoutput> <cfloop index='thisfield' list='#laden.Columnlist#'>
#thisfield##TabChar# </cfloop> #NewLine# </cfoutput>
philh Guest



Reply With Quote

