Last updated on
Feb 25, 2025
Description
Specifies columns that should appear on every page when the sheet is printed.
Returns
None
History
ColdFusion (2025 release): Added the function.
Syntax
spreadsheetSetRepeatingColumns(spreadSheetObject, columns)
Parameters
Name
|
Required
|
Type
|
Description
|
spreadSheetObject
|
Yes
|
ExcelInfo
|
The Excel spreadsheet object to which you must set repeating columns.
|
columns
|
Yes
|
String
|
The range of columns to repeat on every printed page.
|
Example
<cfquery name="art" datasource="cfartgallery">
SELECT * FROM ART
</cfquery>
<cfscript>
theFile=GetDirectoryFromPath(GetCurrentTemplatePath()) & "art-repeat-cols.xls";
// create a spreadsheet object
theSheet=spreadsheetNew("SampleData")
// add rows from the table to the spreadsheet
spreadsheetAddRows(theSheet,art)
// set repeating columns
spreadsheetSetRepeatingColumns(theSheet,"4-5")
// write the spreadsheet
spreadsheetWrite(theSheet,theFile,"yes")
</cfscript>