Link to home
Start Free TrialLog in
Avatar of Tpaul_10
Tpaul_10Flag for United States of America

asked on

Setting a column witdth in ColdFusion And POI Generated Excel Document

Experts,

I need to set column witdth in  ColdFusion And POI Generated Excel Document. Following is the code I have been using based on one of posts before which was answered by AGX.
Please let me know how I can do it.

Here is the link
https://www.experts-exchange.com/questions/27362081/Download-the-data-from-SQL-to-excel-using-CF-9-0.html
<cfquery name="qOne" datasource="cfdocexamples">
    SELECT CORNUMBER,DEPT_ID,COURSE_ID,CORNAME 
    FROM COURSELIST 
</cfquery> 

<CFSET FILE_TEMPLATE = "c:\testTemplate.xls">
<cfset workbook = SpreadSheetRead(FILE_TEMPLATE)>

<cfset SpreadsheetSetActiveSheet(workbook, "First Sheet")>
<cfset SpreadSheetAddRows(workbook, qOne, 1, 1, false ) />      
<cfspreadsheet action="write" filename="c:\output.xls" name="workbook" overwrite="true" />

Open in new window

ASKER CERTIFIED SOLUTION
Avatar of _agx_
_agx_
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial