Exception: ‘An error occurred while reading the Excel: org.apache.poi.hssf .record.RecordFormatException: Duplicate PageSettingsBlock record (sid=0x89c).’ Exception Cause: Using older version of POI jar files.
At times, while reading few .xls files, using cfspreadsheet, we face the following issue:
‘An error occurred while reading the Excel: org.apache.poi.hssf.record.RecordFormatException: Duplicate PageSettingsBlock record (sid=0x89c).’
This is because the default poi jar files-we get with CF installation, do not process all excel files. CF10 gives us version 3.6 beta jar files by default and these do not process all the excel files. So we have to upgrade these jar files for better Excel support in ColdFusion.
Download the latest stable “Binary Distribution” version jar files from “http://poi.apache.org/download.html”. I have downloaded version 3.10 from ”http://mirror.nexcess.net/apache/poi/release/bin/poi-bin-3.10-FINAL-20140208.tar.gz”
Extract the files to a temporary folder.
Navigate to the ColdFusion’s lib folder - “C:\ColdFusion10\cfusion\lib”.
Take a backup of all the jar files starting with “poi-“.
Stop the ColdFusion Service. (Services.msc -> ColdFusionMX Application Server).
Delete the existing poi jar files (jar files starting with poi -) from the “lib” folder (C:\ColdFusion10\cfusion\lib).
Copy the latest jar files, which were extracted to a temporary folder earlier, into the “lib” folder.
Now start the ColdFusion Service.
Execute the file processing the .xls file. It should now be able to read the excel file.