Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

cfspreadsheet Parameter validation error

I am trying to get a basic example to work using cfspreadsheet. But this is the error I am receiving:

Parameter validation error for the SPREADSHEETSETCELLVALUE function.

Code

<cfset objSpreadsheet = SpreadsheetNew()>

<!--- Create and format the header row. --->
<cfset SpreadsheetAddRow( objSpreadsheet, "Location,Percent of Total Checklists,Location Total" )>
<cfset SpreadsheetFormatRow( objSpreadsheet, {bold=true, alignment="center"}, 1 )>

<!--- Populate the spreadsheet. --->
<cfset SpreadsheetSetCellValue( objSpreadsheet, 'FSC', 2, 1, "String" ) >
<cfset SpreadsheetSetCellValue( objSpreadsheet, .03, 2, 2, "Numeric" ) >
<cfset SpreadsheetSetCellValue( objSpreadsheet, 13, 2, 3, "Numeric" ) >
<cfset SpreadsheetSetCellValue( objSpreadsheet, 'OPERATIONS', 3, 1, "String" ) >
<cfset SpreadsheetSetCellValue( objSpreadsheet, 13.78, 3, 2, "Numeric" ) >
<cfset SpreadsheetSetCellValue( objSpreadsheet, 5161, 3, 3, "Numeric" ) >


<cfheader name="Content-Disposition" value="attachment; filename=LS_#Dateformat(NOW(),'MMDDYYYY')#"> 
<cfcontent type="application/vnd.ms-excel" variable="#SpreadsheetReadBinary( objSpreadsheet )#"> 

Any help with this would be greatly appreciated.

like image 300
David Brierton Avatar asked Jan 17 '26 15:01

David Brierton


1 Answers

The datatype (String, Numeric) argument wasn't added until CF11, and is refrenced in the adobe docs under history. If you try to include the data type in CF9 and CF10 you will get the validation error.

You can see your example working on TryCF.com in CF11.

like image 108
Twillen Avatar answered Jan 21 '26 08:01

Twillen



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!