net.sf.excelutils
Class ExcelUtils

java.lang.Object
  extended bynet.sf.excelutils.ExcelUtils

public class ExcelUtils
extends java.lang.Object

ExcelUtils is a class which parse the excel report template

Version:
$Revision: 1.12 $ $Date: 2005/11/17 16:59:15 $
Author:
rainsoft

Field Summary
(package private) static java.lang.ThreadLocal context
           
 
Constructor Summary
ExcelUtils()
           
 
Method Summary
static void addService(java.lang.Object context, java.lang.String key, java.lang.Object service)
           
static void addService(java.lang.String key, java.lang.Object service)
           
static void addValue(java.lang.Object context, java.lang.String key, java.lang.Object value)
          add a object to context
static void addValue(java.lang.String key, java.lang.Object value)
          add a object to default context
static void export(java.io.InputStream inputStream, java.lang.Object context, java.io.OutputStream out)
           
static void export(ServletContext ctx, java.lang.String config, int sheetIndex, java.lang.Object context, java.io.OutputStream out)
          parse the excel template in a sheet and output excel to outputStream.
static void export(ServletContext ctx, java.lang.String config, int sheetIndex, java.io.OutputStream out)
          parse the excel template in a sheet and output excel to outputStream in default context.
static void export(ServletContext ctx, java.lang.String config, java.lang.Object context, java.io.OutputStream out)
          parse the excel template and output excel to outputStream.
static void export(ServletContext ctx, java.lang.String config, java.io.OutputStream out)
          parse the excel template and output excel to outputStream in default context.
static void export(java.lang.String fileName, int sheetIndex, java.lang.Object context, java.io.OutputStream out)
          parse exel and export
static void export(java.lang.String fileName, int sheetIndex, java.io.OutputStream out)
          parse excel and export excel
static void export(java.lang.String fileName, java.lang.Object context, java.io.OutputStream out)
          parse excel and export
static void export(java.lang.String fileName, java.io.OutputStream out)
          parse excel and export excel
static DynaBean getContext()
          get a global context, it's thread safe
static boolean isCanShowType(java.lang.Object value)
          can value be show
static void parseSheet(java.lang.Object context, HSSFSheet sheet)
          parse Excel Template File
static void parseWorkbook(java.lang.Object context, HSSFWorkbook wb)
          parse workbook
static void parseWorkbook(java.lang.Object context, HSSFWorkbook wb, int sheetIndex)
          parse Workbook
static void registerTagPackage(java.lang.String packageName)
          register extended tag package, default is net.sf.excelutils.tags
static void setContext(DynaBean ctx)
          set global context
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

context

static java.lang.ThreadLocal context
Constructor Detail

ExcelUtils

public ExcelUtils()
Method Detail

export

public static void export(ServletContext ctx,
                          java.lang.String config,
                          java.lang.Object context,
                          java.io.OutputStream out)
                   throws ExcelException
parse the excel template and output excel to outputStream.

Parameters:
ctx - ServletContext
config - Excel Template Name
context - All Data
out - OutputStream
Throws:
ExcelException

export

public static void export(ServletContext ctx,
                          java.lang.String config,
                          int sheetIndex,
                          java.lang.Object context,
                          java.io.OutputStream out)
                   throws ExcelException
parse the excel template in a sheet and output excel to outputStream.

Parameters:
ctx -
config -
sheetIndex -
context -
out -
Throws:
ExcelException

export

public static void export(ServletContext ctx,
                          java.lang.String config,
                          java.io.OutputStream out)
                   throws ExcelException
parse the excel template and output excel to outputStream in default context.

Parameters:
ctx -
config -
out -
Throws:
ExcelException

export

public static void export(ServletContext ctx,
                          java.lang.String config,
                          int sheetIndex,
                          java.io.OutputStream out)
                   throws ExcelException
parse the excel template in a sheet and output excel to outputStream in default context.

Parameters:
ctx -
config -
sheetIndex -
out -
Throws:
ExcelException

export

public static void export(java.lang.String fileName,
                          java.lang.Object context,
                          java.io.OutputStream out)
                   throws ExcelException
parse excel and export

Parameters:
fileName -
context -
out -
Throws:
ExcelException

export

public static void export(java.lang.String fileName,
                          int sheetIndex,
                          java.lang.Object context,
                          java.io.OutputStream out)
                   throws ExcelException
parse exel and export

Parameters:
fileName -
sheetIndex -
out -
Throws:
ExcelException

export

public static void export(java.lang.String fileName,
                          java.io.OutputStream out)
                   throws ExcelException
parse excel and export excel

Parameters:
fileName -
out -
Throws:
ExcelException

export

public static void export(java.lang.String fileName,
                          int sheetIndex,
                          java.io.OutputStream out)
                   throws ExcelException
parse excel and export excel

Parameters:
fileName -
sheetIndex -
out -
Throws:
ExcelException

export

public static void export(java.io.InputStream inputStream,
                          java.lang.Object context,
                          java.io.OutputStream out)
                   throws ExcelException
Parameters:
inputStream -
context -
out -
Throws:
ExcelException

parseWorkbook

public static void parseWorkbook(java.lang.Object context,
                                 HSSFWorkbook wb)
                          throws ExcelException
parse workbook

Parameters:
context -
wb -
Throws:
ExcelException

parseWorkbook

public static void parseWorkbook(java.lang.Object context,
                                 HSSFWorkbook wb,
                                 int sheetIndex)
                          throws ExcelException
parse Workbook

Parameters:
context -
wb -
sheetIndex -
Throws:
ExcelException

parseSheet

public static void parseSheet(java.lang.Object context,
                              HSSFSheet sheet)
                       throws ExcelException
parse Excel Template File

Parameters:
context - datasource
sheet - Workbook sheet
Throws:
ExcelException

addService

public static void addService(java.lang.Object context,
                              java.lang.String key,
                              java.lang.Object service)

addService

public static void addService(java.lang.String key,
                              java.lang.Object service)

addValue

public static void addValue(java.lang.Object context,
                            java.lang.String key,
                            java.lang.Object value)
add a object to context

Parameters:
context - must be a DynaBean or Map type
value -

addValue

public static void addValue(java.lang.String key,
                            java.lang.Object value)
add a object to default context

Parameters:
key -
value -

registerTagPackage

public static void registerTagPackage(java.lang.String packageName)
register extended tag package, default is net.sf.excelutils.tags

Parameters:
packageName -

getContext

public static DynaBean getContext()
get a global context, it's thread safe

Returns:
DynaBean

setContext

public static void setContext(DynaBean ctx)
set global context

Parameters:
ctx - DynaBean

isCanShowType

public static boolean isCanShowType(java.lang.Object value)
can value be show

Parameters:
value -
Returns:
boolean


Copyright (C) 200-2005 The ExcelUtils Project.