User Guide Cancel

spreadsheetUngroupColumns

 

Description

Ungroups the columns that were grouped using the spreadsheetGroupColumns function.

Returns

None 

History

  • ColdFusion (2025 release): Added the function.

Syntax

spreadsheetUngroupColumns(spreadSheetObject, int startColumn, int endColumn)
spreadsheetUngroupColumns(spreadSheetObject, int startColumn, int endColumn)
spreadsheetUngroupColumns(spreadSheetObject, int startColumn, int endColumn) 

Parameters

Name

 

 

Required

 

 

Type

 

 

Description

 

 

spreadSheetObject

 

 

Yes

 

 

ExcelInfo 

 

 

The Excel spreadsheet object to which you’ll ungroup columns between two specified columns.

 

 

startColumn

 

 

Yes

 

 

Integer 

 

 

The column number of the row where the column starts.

 

 

endColumn

 

 

Yes

 

 

Integer 

 

 

The column number of the row where the column ends.

 

 

Example

<cfquery name="art" datasource="cfartgallery">
SELECT * FROM ART
</cfquery>
<cfscript>
theFile=GetDirectoryFromPath(GetCurrentTemplatePath()) & "art-col.xls";
// create a spreadsheet object
theSheet=spreadsheetNew("SampleData")
// add rows from the table to the spreadsheet
spreadsheetAddRows(theSheet,art)
// group columns
spreadsheetGroupColumns(theSheet,2,5)
// ungroup the columns
spreadsheetUnGroupColumns(theSheet,2,5)
// write the spreadsheet
spreadsheetWrite(theSheet,theFile,"yes")
</cfscript>
<cfquery name="art" datasource="cfartgallery"> SELECT * FROM ART </cfquery> <cfscript> theFile=GetDirectoryFromPath(GetCurrentTemplatePath()) & "art-col.xls"; // create a spreadsheet object theSheet=spreadsheetNew("SampleData") // add rows from the table to the spreadsheet spreadsheetAddRows(theSheet,art) // group columns spreadsheetGroupColumns(theSheet,2,5) // ungroup the columns spreadsheetUnGroupColumns(theSheet,2,5) // write the spreadsheet spreadsheetWrite(theSheet,theFile,"yes") </cfscript>
<cfquery name="art" datasource="cfartgallery">
    SELECT * FROM ART
</cfquery>
<cfscript>
    theFile=GetDirectoryFromPath(GetCurrentTemplatePath()) & "art-col.xls";
    // create a spreadsheet object
    theSheet=spreadsheetNew("SampleData")
    // add rows from the table to the spreadsheet
    spreadsheetAddRows(theSheet,art)
    // group columns
    spreadsheetGroupColumns(theSheet,2,5)
    // ungroup the columns
    spreadsheetUnGroupColumns(theSheet,2,5)
    // write the spreadsheet
    spreadsheetWrite(theSheet,theFile,"yes")
</cfscript>

Get help faster and easier

New user?