"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 »
11,314 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 »
11,314 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
Ben Nadel's Company - Epicenter Consulting Recent Blog Comments
Jun 18, 2013 at 9:20 PM
Mapping AngularJS Routes Onto URL Parameters And Client-Side Events
I couldn't find examples of passing multiple arguments using the when() routing statement so figured out through trial and error that you can pass multiple arguments using the following format: .whe ... read »
Jun 18, 2013 at 3:39 PM
Experimenting With The Amazon Simple Storage Service (S3) API Using ColdFusion
Hi Ben, THANKS! While not bleeding edge, it is new to me & I like learning new things every day! ... read »
Jun 18, 2013 at 12:30 PM
Disabling Auto-Correct And Auto-Capitalize Features On iPhone Inputs
Also spellcheck="false" should be mentioned as part of html5 specs ... read »
Jun 18, 2013 at 8:40 AM
Using Named Functions Within Self-Executing Function Blocks In Javascript
Hi Ben, you forgot to mention the most important thing for named self-executing functions - they can be referenced by name ONLY inside their execution context (which is parens in this case), it mean ... read »
dee
Jun 18, 2013 at 7:01 AM
My Safari Browser SQLite Database Hello World Example
hai ben, this program is really good i could understand the concept but i dint know how to save it and how to open it as you have done in the video can u give that details pls ... read »
Jun 18, 2013 at 6:04 AM
Clearing Inline CSS Properties With jQuery
Thanks a lot for for post! It helped me a lot... after being stuck since 24 hrs.. found solution from your post. Thanks again! ... read »
Jun 18, 2013 at 2:31 AM
SOTR 2013 - The Best Conference I Never Went To
I keep watching it, should keep me happily distracted until SotR14 ;) ... read »
Jun 17, 2013 at 9:45 PM
What If All User Interface (UI) Data Came In Reports?
@Jonah, As I was reading what you wrote, it occurred to me that maybe I do something similar to that in some of my client-side code. In an application I'm working on, there are a bunch of unrelated ... read »
InVision App - Prototyping Made Beautiful With Prototyping Tools