SpreadsheetSetHeader

Description

Adds a header to the specified worksheet.

Returns

Nothing

Category

Microsoft Office Integration

Function syntax

SpreadsheetSetHeader(spreadhsheetobj, left header, center header, right header)

History

ColdFusion 9: Added the function.

Parameters

Parameter

Description

spreadsheetobj

The Excel spreadsheet object to which to add the header.

left header

Adds the header in the left side of the worksheet.

center header

Adds the header in the center of the worksheet.

right header

Adds the header in the right side of the worksheet.

Usage

The header that you add appears on the printed worksheet document.

Example

The following example adds a header in the center of the worksheet.

<cfspreadsheet action="read" src="#dirname#SingleSheet.xls" sheet="2" name="SpreadsheetObj" ><cfset spreadsheetSetHeader(SpreadsheetObj,"left header","center header","right header")><cfset spreadsheetSetFooter(SpreadsheetObj,"left footer","center footer","right footer")><cfspreadsheet action="write" filename="#dirname#MySheet.xls"  name="SpreadsheetObj" overwrite="true" >