User Guide Cancel

spreadsheetSetColumnHidden

 

Description

Hides or shows a specified column in a spreadsheet.

Returns

None 

History

  • ColdFusion (2025 release): Added the function.

Syntax

spreadsheetSetColumnHidden(spreadSheetObject,column,hide)
spreadsheetSetColumnHidden(spreadSheetObject,column,hide)
spreadsheetSetColumnHidden(spreadSheetObject,column,hide)

Parameters

Name

 

 

Required

 

 

Type

 

 

Description

 

 

spreadSheetObject

 

 

Yes

 

 

ExcelInfo 

 

 

The Excel spreadsheet object where the row is to be hidden or displayed.

 

column

 

 

Yes

 

 

Integer 

 

 

The column number which needs to be hidden.

 

 

hide

 

 

No

 

 

Boolean 

 

 

True to hide the row. False to show the row.

 

 

Example

<cfquery name="art" datasource="cfartgallery">
SELECT * FROM ART
</cfquery>
<cfscript>
theFile=GetDirectoryFromPath(GetCurrentTemplatePath()) & "art-another.xls";
// create a spreadsheet object
theSheet=spreadsheetNew("SampleData")
// add rows from the table to the spreadsheet
spreadsheetAddRows(theSheet,art)
// hide column 6 in the spreadsheet
spreadsheetSetColumnHidden(theSheet,6,"TRUE")
// write the spreadsheet
spreadsheetWrite(theSheet,theFile,"yes")
// show column 6 that was previously hidden
spreadsheetSetColumnHidden(theSheet,6,"FALSE")
// write the spreadsheet
spreadsheetWrite(theSheet,theFile,"yes")
</cfscript>
<cfquery name="art" datasource="cfartgallery"> SELECT * FROM ART </cfquery> <cfscript> theFile=GetDirectoryFromPath(GetCurrentTemplatePath()) & "art-another.xls"; // create a spreadsheet object theSheet=spreadsheetNew("SampleData") // add rows from the table to the spreadsheet spreadsheetAddRows(theSheet,art) // hide column 6 in the spreadsheet spreadsheetSetColumnHidden(theSheet,6,"TRUE") // write the spreadsheet spreadsheetWrite(theSheet,theFile,"yes") // show column 6 that was previously hidden spreadsheetSetColumnHidden(theSheet,6,"FALSE") // write the spreadsheet spreadsheetWrite(theSheet,theFile,"yes") </cfscript>
<cfquery name="art" datasource="cfartgallery">
    SELECT * FROM ART
</cfquery>
<cfscript>
    theFile=GetDirectoryFromPath(GetCurrentTemplatePath()) & "art-another.xls";
    // create a spreadsheet object
    theSheet=spreadsheetNew("SampleData")
    // add rows from the table to the spreadsheet
    spreadsheetAddRows(theSheet,art)
    // hide column 6 in the spreadsheet
    spreadsheetSetColumnHidden(theSheet,6,"TRUE")
    // write the spreadsheet
    spreadsheetWrite(theSheet,theFile,"yes")
    // show column 6 that was previously hidden
    spreadsheetSetColumnHidden(theSheet,6,"FALSE")
    // write the spreadsheet
    spreadsheetWrite(theSheet,theFile,"yes")
</cfscript>

Get help faster and easier

New user?