spreadsheetCreateSheet

Create spreadsheet from given spreadsheet object

spreadsheetCreateSheet(spreadsheetObj, name) → returns void

Argument Reference

spreadsheetObj variableName
Required

No Help Available

name string
Required

No Help Available

Examples
Sample code invoking the spreadsheetCreateSheet function

The following example creates two sheets: CourseData and EvaluationSheet.

<cfscript>
// Make a spreadsheet object
spreadsheet = spreadsheetNew("Sheet A");

// add a new sheet
spreadsheetCreateSheet(spreadsheet, "Sheet B");

// set the new sheet to be the active one
SpreadsheetSetActiveSheet(spreadsheet, "Sheet B");

// populate Sheet B
i = 1;
while (i < 10) {
    SpreadsheetSetCellValue(spreadsheet, "col #i#", 1, i);
    i++;
}

</cfscript>
<cfheader name="Content-Disposition" value="inline; filename=testFile.xls">
<cfcontent type="application/vnd.msexcel" variable="#SpreadSheetReadBinary(spreadsheet)#">

Signup for cfbreak to stay updated on the latest news from the ColdFusion / CFML community. One email, every friday.

Fork me on GitHub