Skip to main content
Ben Nadel at Scotch On The Rock (SOTR) 2010 (Brussels) with: Ray Camden
Ben Nadel at Scotch On The Rock (SOTR) 2010 (Brussels) with: Ray Camden ( @cfjedimaster )

"Style Bleed" Problem Fixed In POI Utility Tags

By on
Tags:

For those of you using my POI Utility ColdFusion custom tags to produce formatted Excel documents for use with Microsoft Excel 2007, you might have seen documents that looks like this:


 
 
 

 
POI Utiltiy Style Bleed Issue In Microsoft Excel 2007.  
 
 
 

Here, you can see that style applied to the header row is bleeding into some of the other rows. Nathan Mische discovered that this was due to my dependence on the undocumented .hashCode() method on ColdFusion structs; he was able to fix this problem by caching the CellStyle objects using a Java Hashtable rathern than a ColdFusion struct. I have taken that logic and worked it back into both the ColdFusion 8 and ColdFusion 7 versions of the POI custom tags.

Additionally, based on a tip from Chris Pijl, I have added the ability to set the default zoom for a workbook sheet. This defaults to 100% and can be overridden using a percentage value.

The latest code can be downloaded from my POI Utility project page.

Reader Comments

15,640 Comments

@Zac,

The only way I have gotten images to work is to put them manually into an existing Excel document and then using that document as Template. I have not dynamically inserted an image in yet.

Once, I fooled around with the idea of an image tag:

<poi:img file="" />

... but, I couldn't get it to work. Can't remember exactly why, bit I think the image insert code might not be compatible with the version of POI that ships with CF.

55 Comments

I was banging my head against the wall with a bug I had using the POI lib and upgraded my local version. I seem to remember reading that the image stuff is newer than the ancient CF version.

The bug by the way was using the cell aliases but accidently naming the alias with the @ prefix... which mean they where @@final_score not @final_score.. doh!

Any chance of supporting it with a version check against POI? or do you have the old code lying around, I'm happy to hack it?

15,640 Comments

@Zac,

I never got the old code working since it was giving me class instantiation errors :(

But, I do like the idea of having some sort of version check. That woudl be awesome! What would be awesome would be to somehow ship the custom tags with the actual JAR and dynamically load the JAR with the custom tag. Not sure what kind of package collissions that would cause :) Probably will need to check with Elliott Sprehn or Mark Mandel on that topic.

I believe in love. I believe in compassion. I believe in human rights. I believe that we can afford to give more of these gifts to the world around us because it costs us nothing to be decent and kind and understanding. And, I want you to know that when you land on this site, you are accepted for who you are, no matter how you identify, what truths you live, or whatever kind of goofy shit makes you feel alive! Rock on with your bad self!
Ben Nadel