Created attachment 22268 [details] patch to fix above bug Attached is a patch to fix a bug occured, if '_isUncalced' (setForceFormulaRecalculation) flag is set and the sheet contain a diagram in POI Version 3.1 Final. The exception thrown is 'IllegalStateException' with different sizes for serialized and pre-calculated size. If a diagramm is inside a sheet it generates another 'BOFRecord' as seen in Sheet line 829. This serialize more then one 'UncalcedRecord' records, pre-calculation count only one. The patch extend the if statement to output the 'UncalcedRecord' only once.
Thanks for this patch. I've committed it to svn, along with a unit test to verify that everything's working properly (and stays working properly!)