Whatever message this page gives is out now! Go check it out!

spreadsheetGroupRows

Last update:
May 18, 2026

Description

Groups rows in a spreadsheet to allow you to organize and manage large data sets by collapsing or expanding sections of rows.

Returns

None

History

  • ColdFusion (2025 release): Added the function.

Syntax

spreadsheetGroupRows(spreadSheetObject, int startRow, int endRow)

Parameters

Name
Required
Type
Description
spreadSheetObject
Yes
ExcelInfo
The Excel spreadsheet object to which you’ll group rows between two specified rows.
startRow
Yes
Integer
The row number of the row where the group starts.
endRow
Yes
Integer
The row number of the row where the group ends.

Example

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

Share this page

Was this page helpful?
We're glad. Tell us how this page helped.
We're sorry. Can you tell us what didn't work for you?
Thank you for your feedback. Your response will help improve this page.

On this page