Return-Path: Delivered-To: apmail-cocoon-users-archive@www.apache.org Received: (qmail 77949 invoked from network); 25 Jun 2008 15:21:51 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 25 Jun 2008 15:21:51 -0000 Received: (qmail 9736 invoked by uid 500); 25 Jun 2008 15:21:50 -0000 Delivered-To: apmail-cocoon-users-archive@cocoon.apache.org Received: (qmail 9676 invoked by uid 500); 25 Jun 2008 15:21:49 -0000 Mailing-List: contact users-help@cocoon.apache.org; run by ezmlm Precedence: bulk list-help: list-unsubscribe: List-Post: Reply-To: users@cocoon.apache.org List-Id: Delivered-To: mailing list users@cocoon.apache.org Received: (qmail 9640 invoked by uid 99); 25 Jun 2008 15:21:49 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 25 Jun 2008 08:21:49 -0700 X-ASF-Spam-Status: No, hits=2.6 required=10.0 tests=DNS_FROM_OPENWHOIS,SPF_HELO_PASS,SPF_PASS,WHOIS_MYPRIVREG X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of lists@nabble.com designates 216.139.236.158 as permitted sender) Received: from [216.139.236.158] (HELO kuber.nabble.com) (216.139.236.158) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 25 Jun 2008 15:20:59 +0000 Received: from isper.nabble.com ([192.168.236.156]) by kuber.nabble.com with esmtp (Exim 4.63) (envelope-from ) id 1KBWo9-00077I-NL for users@cocoon.apache.org; Wed, 25 Jun 2008 08:21:17 -0700 Message-ID: <18115088.post@talk.nabble.com> Date: Wed, 25 Jun 2008 08:21:17 -0700 (PDT) From: Matthew Monkan To: users@cocoon.apache.org Subject: Odd Behavior with HSSFSerializer MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Nabble-From: matthew@ieee.org X-Virus-Checked: Checked by ClamAV on apache.org I produced a simple Excel document by querying my database and using the HSSFSerializer. It's a simple document; the spreadsheet just formats the data into the same grid layout you would see on a database GUI upon submitting the query. Anyway, I realized that no matter the numerical data that goes into the HSSFSerializer, Excel defaults to outputting them with the trailing 0's cut off. (22.90 becomes 22.9.) I downloaded Gnumeric, formatted numbers to show 2 decimal places, saved the document to Gnumeric XML, and opened it to see what XML was needed to format the decimal properly. (I want all my numbers rounded to two decimal places.) Here is the XML I currently use in my stylesheet: If you look at 's Format attribute, this is the input that is needed to produce the correct decimal places. This specific snippet of code should round all data in Column 6 (Gnumeric starts counting at 0, so Col="5" is the sixth column) starting at row 3 and ending with the last row of data. If you look at the count function under , this returns the value 4500 from my particular test data. This dynamically tells what row to stop applying the formatting to. There is no way to specify unbounded for endRow, so this count function is the only way I can get it to apply the formatting to every row for any instance of data queried. Now here's the "odd behavior". This code works perfectly when I query data that is a few hundred rows long. If there is, for example, 500 rows being queried the count function correctly returns 503, which is the last row I want formatted. (My data outputs on rows 3 to 503 to make room for a heading.) But when I query data from around 700 or so upward (I haven't found an exact cutoff yet), it will never apply the formatting. (All the numbers will have trailing 0's cut off and not rounded to two decimal places.) This is extremely irritating, and this will need to work for thousands of rows. If I simply replace the count fuction with a number like 250, it works. (Rows 3-253 are formatted properly, and the few thousand remaining are left unformatted.) If I start putting in values like 2000, 3500, 11480, it won't apply formatting to ANY row. It gives me the cold shoulder.:-O I was wondering if anyone ran has run into a similar problem and knows a fix. If I was ambiguous anywhere, just let me know and I'll clarify. Thanks, Matt -- View this message in context: http://www.nabble.com/Odd-Behavior-with-HSSFSerializer-tp18115088p18115088.html Sent from the Cocoon - Users mailing list archive at Nabble.com. --------------------------------------------------------------------- To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org For additional commands, e-mail: users-help@cocoon.apache.org