Home     Products      Support      Corporate     Sign In 

JavaHow POI Stacks Up
Against OfficeWriter

OfficeWriter Requires Only 25 Lines of Code

In just under 25 lines of actual code (comments & spacing not included), OfficeWriter creates the same spreadsheet that it took 100 lines to create with POI.

Discover how to generate native Excel and Word reports with OfficeWriter from your front-end Java™ web application.

 OfficeWriter Resources

 OfficeWriter Demos

 Evaluation Software Login to Access this Item


import java.util.Date;

import com.softartisans.excelwriter.ExcelTemplate;
/** * An ExcelWriter test that creates the same output file as POITest.java. */ public class XLWTest {
public static void main(String[] args) throws Exception { long startTime, stopTime; startTime = System.currentTimeMillis();
// Create the data objects (this would usually // be a ResultSet or something similar. Object[][] data = new Object[10][100];
for (int i=0; i<data.length; i++) { for (int j=0; j<data[0].length; j++) {
// String data if (i==0) data[i][j] = "Product " + j; else if (i<9) { data[i][j] = new Integer((int)(Math.random()*100)); } else data[i][j] = new Date(); } }
// Create the ExcelTemplate object and populate it. ExcelTemplate xlt = new ExcelTemplate(); xlt.open("template.xls"); xlt.setDataSource(data,null,"Data"); xlt.process(); xlt.save("XLWOut.xls");
stopTime = System.currentTimeMillis();
System.out.println("XLW generation took " +(stopTime-startTime)+"ms"); }
}
OfficeWriter
Evaluate
Features
OfficeWriter Features
Office on the Server
Two-Way Data Update
Return on Investment
Performance Testing
New Features in v3.5
Features for Excel
Features for Word
Customers & Partners
OfficeWriter Customers
Customer List
Success Stories
Product Reviews
OfficeWriter Partners
OEM & Reseller
Web Hosting
Platforms
OfficeWriter Platforms
ASP & ASP.NET
SQL Reporting Services
System Requirements
Product Resources
OfficeWriter Resources
OfficeWriter FAQ
Getting Started
System Requirements
Brochures
Order OfficeWriter
Order OfficeWriter
Developer License
Order Upgrade
Pricing & Licensing
Self-Help Resources
Support Home
Knowledge Base
OfficeWriter Docs
OfficeWriter Forums
Sample Code
Version Differences
Support Options
Support Subscriptions
Maintenance Plans
Per-Issue Support
Consulting
Training
Support Request Form
Downloads
Evaluation Software
Product Updates
Corporate
About SoftArtisans
Contact Us
Partners
Resellers & OEMs
Web Hosting
Order Info/Privacy Policy
Career Opportunities

To learn more about Officewriter and pricing information, contact SoftArtisans:

 
Email: sales@softartisans.com
Toll Free:1(877)SOFTART(763-8278), option 1
International:+1(617)607-8800, option 1
Purchase  |  Evaluate  |  Demos  |  Support  |  Contact Us  |  Site Map
Copyright 2008 © SoftArtisans, Inc. All Rights Reserved.