Thursday, 22 May 2014

An error occurred while reading the Excel: org.apache.poi.hssf.record.RecordFormatException: Duplicate PageSettingsBlock record (sid=0x89c).

ISSUE IF POI JAR FILES ARE NOT UPGRADED
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.
Description:
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.

  
Solution:
1.       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


2.       Extract the files to a temporary folder.
3.       Navigate to the ColdFusion’s lib folder - “C:\ColdFusion10\cfusion\lib”.
4.       Take a backup of all the jar files starting with “poi-“.


5.       Stop the ColdFusion Service. (Services.msc  -> ColdFusionMX Application Server).

6.       Delete the existing poi jar files (jar files starting with poi -) from the “lib” folder (C:\ColdFusion10\cfusion\lib).
7.       Copy the latest jar files, which were extracted to a temporary folder earlier, into the “lib” folder.
8.       Now start the ColdFusion Service.
9.       Execute the file processing the .xls file. It should now be able to read the excel file.

J

No comments:

Post a Comment