tracker issue : CF-4185751

select a category, or use search below
(searches all categories and all time range)
Title:

cfspreadsheet format="csv" columns="anyOneColumn" NullPointerException when Excel contain empty row at end.

| View in Tracker

Status/Resolution/Reason: Closed/Fixed/Fixed

Reporter/Name(from Bugbase): Yeou Sunn Liu / Yeou Sunn Liu (Yeou Sunn Liu)

Created: 08/31/2016

Components: Document Management, Office Integration

Versions: 2016,11.0,10.0

Failure Type:

Found In Build/Fixed In Build: Final / 302356

Priority/Frequency: Major / Some users will encounter

Locale/System: English / Win All

Vote Count: 0

Listed in the version 2016.0.04.302561 Issues Fixed doc
Problem Description: NullPointerException is thrown by cfspreadsheet when trying to get a single column , and excel sheet contains empty rows containing some formatting at the end of the sheet. (Works when getting multiple column.)

Steps to Reproduce:
    <cfset dest = "E:\TestExcel\test2.xlsx">

    <cfspreadsheet 
      action="read" 
      sheet=1 
      columns="4"
      src="#dest#"
      format="csv"
      name="emailRows"
     > 

Actual Result: The system has attempted to use an undefined value, which usually indicates a programming error, either in your code or some system code.

Null Pointers are another name for undefined values. 

Expected Result: Column values in CSV format.

Any Workarounds: use query and get the column value using evaluate.

<cfset dest = "E:\TestExcel\test2.xlsx">
<cfspreadsheet 
      action="read" 
      src="#dest#"
      query="emailRows"
  >
  <cfset colval= 4>
 <cfset finalListEmail = "">
  <cfloop query="emailRows">
  	<cfif CurrentRow neq 1>
		<cfset finalListEmail = ListAppend(finalListEmail, evaluate('col_#colval#'))>  
	  </cfif>
  </cfloop>

----------------------------- Additional Watson Details -----------------------------

Watson Bug ID:	4185751

External Customer Info:
External Company:  
External Customer Name: Yeou Sunn Liu
External Customer Email:  
External Test Config: My Hardware and Environment details: Windows 10, 12GB RAM, CORE I5

Attachments:

  1. August 31, 2016 00:00:00: 1_cfspreadsheet_nullpointer_exception.zip

Comments: