• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Write Excel file line-by-line?

 
Greenhorn
Posts: 26
1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi, All,

I'm attempting to write a report generator that will read data from a database and create and write it to an excel file. I have it working at the moment, but the solution I found (Apache POI) requires holding the entire excel document in memory prior to writing it.  This is fine for smaller reports, but the business requirements allow for arbitrary-sized reports (eg, generate list of all records in a given table), and I'm worried about memory usage. I've seen references to an ability to write XLSX files line-by-line, but I can't find any information on how that might be done. Does anyone have any recommendations? (Note: I've tried writing csv files, but since we have large numbers in our database, we've run into the issue that Excel automatically zeroes out any digits beyond the 15th of a long number.)
 
Rancher
Posts: 4801
50
  • Likes 2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
SXSSF.
That's probably the one you're looking for.
 
Matt Dalen
Greenhorn
Posts: 26
1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Dave Tolls wrote:SXSSF.
That's probably the one you're looking for.



yep, that looks like it will do it!  Thanks muchly!
 
Yeah, but does being a ninja come with a dental plan? And what about this tiny ad?
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic