Ben Nadel
On User Experience (UX) Design, JavaScript, ColdFusion, Node.js, Life, and Love.
I am the chief technical officer at InVision App, Inc - a prototyping and collaboration platform for designers, built by designers. I also rock out in JavaScript and ColdFusion 24x7.
Meanwhile on Twitter
Loading latest tweet...
Ben Nadel at cf.Objective() 2011 (Minneapolis, MN) with:

"Style Bleed" Problem Fixed In POI Utility Tags

By Ben Nadel on
Tags: ColdFusion

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

@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.

Reply to this Comment

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?

Reply to this Comment

@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.

Reply to this Comment

Post A Comment

You — Get Out Of My Dreams, Get Into My Comments
Live in the Now
Oops!
Comment Etiquette: Please do not post spam. Please keep the comments on-topic. Please do not post unrelated questions or large chunks of code. And, above all, please be nice to each other - we're trying to have a good conversation here.