"Style Bleed" Problem Fixed In POI Utility Tags

Posted September 24, 2008 at 3:57 PM by Ben Nadel

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

Oct 6, 2008 at 10:59 AM // reply »
18 Comments

Hey Ben,

is it possible to add support to the poi library to allow embedding images
into an excel document? I am specifically thinking about taking a PNG
CFCHART and embedding it into excel

http://poi.apache.org/hssf/quick-guide.html#Images

Glad you enjoyed my post about my blogs name :)


Oct 6, 2008 at 11:10 AM // reply »
10,743 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.


Oct 6, 2008 at 11:30 AM // reply »
18 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?


Oct 6, 2008 at 11:34 AM // reply »
10,743 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.


Post A Comment

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.

Please review the following issues:

Author Name:


Author Email:

Author Website:

Comment:

Supported HTML tags for formatting: <strong>bold</strong>   <em>italic</em>   <code>code</code>







  • Help Wanted - Find Your Next ColdFusion Job
InVision App - Prototyping Made Beautiful With Prototyping Tools Ben Nadel's Company - Epicenter Consulting Recent Blog Comments
May 16, 2012 at 8:18 PM
Best Of ColdFusion 10 Contest Entry - HTML Email Utility
Just found this, looks good! I'm trying to run it on local, it's the 64bit version and I'm experiencing horrible lag. On average the generate.cfm processes the content change in 60-90 seconds. I've ... read »
May 16, 2012 at 6:40 PM
Maintaining Sessions Across Multiple ColdFusion CFHttp Requests
I am trying to integrate this CFHTTPsession into an application that will log into zeekrewards.com to post ads and I am not having any luck. The code works perfectly for logging into other websites, ... read »
May 16, 2012 at 2:44 PM
Creating A Sometimes-Fixed-Position Element With jQuery
Thank you, very useful technique! Worked like a charm. ... read »
May 16, 2012 at 1:58 PM
Movies As A Religious Experience
Acting can, in a way, ruin the movie-goer's experience. I used to be able to get so caught up in movies and their plots, and totally engaged. But lately, I haven't been able to as much with a lot o ... read »
May 16, 2012 at 1:52 PM
The Science Of Optimal Post-Exercise Nutrition
children of this age eat very less vegetables so u can opt for salads they will like it also carrot ,cucumber,onion and as far as pulses are concerned u can boil them ,give him along with mashed rice ... read »
May 16, 2012 at 1:34 PM
Strange ColdFusion JRUN Stack Overflow Error
Hey, Recently I updated my jrun4 using the latest updater 7 and now i am having memory issues :(:(:( any help is appreciated ... read »
May 16, 2012 at 9:56 AM
ColdFusion 10 Beta, Apache Tomcat, And Symbolic Links On Mac OSX
Hi, Now that ColdFusion 10 is out I have stumbled over this as well and I cannot figure out the proper solution. We're running virtual hosts via Apache2; the ColdFusion-applications store their fil ... read »
May 15, 2012 at 6:03 PM
Movies As A Religious Experience
@Ben, I don't know whether you'd consider this a religious observation, but it seems to me, in a sense, movies multiply how many lives we get to have. Each movie is like a little extra life we get ... read »