spreadsheetSetColumnWidth

Sets the width of a column in a worksheet.

spreadsheetSetColumnWidth(spreadsheetObj, columnNumber, width) → returns void

Argument Reference

spreadsheetObj variableName
Required

The Excel spreadsheet object to which to set the column width.

columnNumber numeric
Required

Specifies the column to set the width.

width numeric
Required

Specifies the width in points.

Examples
Sample code invoking the spreadsheetSetColumnWidth function

Here,we've example to set the width for particular column in excel.

<cfset Detail=SpreadsheetNew("student",false)>
<cfset SpreadSheetAddRow(Detail,"id,Name,age")>
<cfset SpreadSheetAddRow(Detail,"1,Dhar,10")>
<cfset spreadsheetSetColumnWidth(Detail,1,50)>
<cfset SpreadsheetWrite(Detail,expandPath("./Detail.xls"),true)>

Signup for cfbreak to stay updated on the latest news from the ColdFusion / CFML community. One email, every friday.

Fork me on GitHub