

![]() | Start a set with this search |
![]() | Include this search in one of my sets |
![]() | Exclude this search from one of my sets |
![]() | Permalink to these results Paste this link in email or IM: |
| Atom feed for tracking future search results Paste this URL into your reader: |
3 messages in org.apache.poi.userRe: Very strange issue w/HSSF serializer| From | Sent On | Attachments |
|---|---|---|
| Savino, Matt C | Dec 9, 2003 6:01 pm | |
| Savino, Matt C | Dec 10, 2003 11:24 am | |
| Andrew C. Oliver | Dec 10, 2003 12:35 pm |

![]() | Permalink for this message Paste this link in email or IM: |
![]() | Permalink for this thread Paste this link in email or IM: |
| Atom feed for this thread Paste this URL into your reader: |
| Subject: | Re: Very strange issue w/HSSF serializer | Actions... |
|---|---|---|
| From: | Andrew C. Oliver (acol...@apache.org) | |
| Date: | Dec 10, 2003 12:35:37 pm | |
| List: | org.apache.poi.user | |
Gnumeric liked to create style regions FOR NO REASON that just declared the unused part of the workbook. So these would be Dimension - used area. They would use whatever geometric function to fill that space in with black/white. So that being needless styles I assume this code is saying "swallow mega regions that serve no purpose" as the default style should clear that up. I don't think even gnumeric even needed these...it just did it for fun.
You should be okay doing as you suggest. Gnumeric used to create an excessive number of these sometimes which would > the number of styles Excel could handle.
I would like to totally revisit the Serializer one day if I have time and make a 1-1 correlation with the records. I'd actually like to make POI a backend to XMLBeans (xml.apache.org/xmlbeans)... However, finding time to do it since its not really a business case but a personal itch. Then we could ditch the whole front end API.... Radical? Yes.
-andy
On 12/10/03 2:25 PM, "Savino, Matt C" <Matt...@questdiagnostics.com> wrote:
In case anyone is interested, I found the cause of this problem in EPStyleRegion.java (attached). Here is the relevant code:
//kludge constant to fix gnumeric's love of declaring large stlye regions //for the blank sections of the sheet w/no apparent purpose that we can // private int MAX_AREA = 2001;
{...}
if(region.getArea() < MAX_AREA) { //protect against stupid mega regions //of generally NOTHING and no real //puprose created by gnumer
// getLogger().debug("region added"); System.out.println("region added"); _style = getSheet().addStyleRegion(region); //test
} else { invalid = true; }
I changed the MAX_AREA constant to 65536 so that it could handle one entire column. I saved the Excel file using both MAX_AREAs and at least for my app there was no appreciable difference in file size (765k v. 766k). Does anyone know what these "mega style regions" are? Is this something specified in the .gmr file, IE - created by the user, or is it something done automatically by gnumeric?
thx Matt
-----Original Message----- From: Savino, Matt C Sent: Tuesday, December 09, 2003 6:02 PM To: poi-...@jakarta.apache.org Subject: Very strange issue w/HSSF serializer
It seems that my date formatted style regions stop creating style at 2000 rows. As long as my spreasheet is 2001 rows or less (I have one header row), my dates are nicely formatted, but if they go over that, I see the raw number (32334.344233...). Has anyone else seen this problem? Is this some weird Excel limitation?
I have attached the xslt stylesheet I use to create the .gmr file. The problem is in the gmr:StyleRegion element below. If I set the spread between the startRow and endRow to 2000 or less, those cells get converted to dates, regardless of where they are in the column. But if I try to make the region any bigger than 2000 rows, none of the cells in the column show up as dates.
<<qb_XmlToXls.xsl>>
<!-- date columns --> <xsl:for-each select="ColumnName//Label"> <xsl:if test="@dataType = 'date'">
<gmr:StyleRegion startCol="{position()-1}" endCol="{position()-1}" startRow="1" endRow="2001"> <gmr:Style HAlign="1" VAlign="4" WrapText="0" Orient="1" Shade="0" Indent="0" Locked="0" Hidden="0" Fore="0:0:0" Back="FFFF:FFFF:FFFF" PatternColor="0:0:0" Format="d-mmm-yy"> <gmr:Font Unit="10" Bold="1" Italic="0" Underline="0" StrikeThrough="0">Helvetica</gmr:Font> <gmr:StyleBorder> <gmr:Top Style="0"/> <gmr:Bottom Style="0"/> <gmr:Left Style="0"/> <gmr:Right Style="0"/> <gmr:Diagonal Style="0"/> <gmr:Rev-Diagonal Style="0"/> </gmr:StyleBorder> </gmr:Style> </gmr:StyleRegion>
</xsl:if> </xsl:for-each>
I can go into more depth but I figure if someone else has run into this, they should knwo the answer right off.
thx a lot
Matt Savino
Senior Web Developer Quest Diagnostics Inc. 33608 Ortega Hwy - Bldg C San Juan Capistrano, CA 92690 949.728.4832 cel - 310-344-0889 Balboa # - 818-895-6868
-- Andrew C. Oliver http://www.superlinksoftware.com/poi.jsp Custom enhancements and Commercial Implementation for Jakarta POI
http://jakarta.apache.org/poi For Java and Excel, Got POI?
The views expressed in this email are those of the author and are almost definitely not shared by the Apache Software Foundation, its board or its general membership. In fact they probably most definitively disagree with everything espoused in the above email.







