• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 166
  • Last Modified:

Urgent!!!!!!!!! export to excel

I've having problem to export to excel on web. when user open the file.

Name, age
Smith Hunter  35

This will become three clolumns. it should be Smith,Hunter 35

Can someone tell me how to do the query?

select '"' name ||'",||age

#name,#age (also it seems that it couldn't find name and age from the query
1 Solution
Simply create a table in the page

<cfquery datasource="#YourDSN#" name="GetRecords">
SELECT Name, Age FROM mytable
<cfheader name="content-disposition" value="inline;filename=Results.xls">
<cfcontent type="application/msexcel">
<table border="1">
      <cfoutput query="GetRecords">

That is the entire page.

Also note you should not used reserved words like "Name" as any column names.

Featured Post

How to Use the Help Bell

Need to boost the visibility of your question for solutions? Use the Experts Exchange Help Bell to confirm priority levels and contact subject-matter experts for question attention.  Check out this how-to article for more information.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now