Contact Us  Contact Us
empty
  
 
SilverDust - The Secure Access to Mobile SharePoint
Recently Launched! SilverDust, The Secure Access to Mobile SharePoint.
visit site  
 
 
  
 
Packaged Services
New OfficeWriter Support Packages
  Learn more  
 
 
  
New OfficeWriter V4.1
Features & Benefits
Learn more
 
 
  
Upcoming Shows:
Visit us at the SharePoint Evolution Conference!
 
 
empty
Skip Navigation LinksOfficeWriter Home > officewriter-305.aspx


How POI Stacks Up Against OfficeWriter
divider
 
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.

 
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"); }
}
Purchase | Evaluate | Demos | Support | Contact Us | Site Map
Copyright 2010 © SoftArtisans, Inc. All Rights Reserved.