Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

Cffile - Blank lines in Excel

New Here ,
Aug 21, 2008 Aug 21, 2008
I am writing records into excel file using CFFILE. The charset is UTF16 as I need to insert Korean characters.

But I realised blank line is inserted to every record.
Can someone advise how can I remove the blank line.
TOPICS
Getting started
632
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Aug 21, 2008 Aug 21, 2008
You probably have too many table tags. For the entire file, you only need one at the start and one at the end.

Try using cfsavecontent to create your entire table and then output the resulting variable into your file.
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Participant ,
Aug 21, 2008 Aug 21, 2008
You were appending a second table to the first.
Solution: Use <cfsavecontent> and write your content into the Excel file.

<cfprocessingDirective pageencoding="utf-8">
<cfset setEncoding("form","utf-8")>
<cfquery name="GetScreen_Login" dataSource="VOCTEST">
select STR_EN, STR_FXK FROM VC_SCREEN_STR where STR_SECTION = 'LOGIN'
</cfquery>

<!--- Create table --->
<cfsavecontent variable="myExcelTable">
<table border="1" cellpadding="0" cellspacing="0">
<tr valign="top">
<td><b>Eng</b></td>
<td><b>Kor</b></td>
</tr>
<cfoutput query="GetScreen_Login">
<tr valign="top">
<td>#STR_EN#</td>
<td>#STR_FXK#</td>
</tr>
</cfoutput>
</table>
</cfsavecontent>

<!--- Write table to Excel File --->
<cffile action="write" file="D:\CustomerVoice\Test_Excel.xls" addnewline="no" charset = "utf-16" output="#myExcelTable#" />
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Aug 21, 2008 Aug 21, 2008
LATEST
Thank you all for the advise.
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Resources