Style Intelligence v12.0

inetsoft.report.io
Class ExcelGenerator

java.lang.Object
  extended by inetsoft.report.io.AbstractGenerator
      extended by inetsoft.report.io.ExcelGenerator
All Implemented Interfaces:
Generator
Direct Known Subclasses:
ExcelSheetGenerator

public class ExcelGenerator
extends AbstractGenerator

This is an excel generator. It takes a report, or a collection of generated pages, and converts the output to an excel file. The excel output mimics the report layout and have all the information in the report. Due to layout differences, there may be some differences on the look-and-feel of the output and original report.


Nested Class Summary
 class ExcelGenerator.HeaderOrFooterInfo
          Inner class to hold informations of elements in header and footer.
 
Field Summary
protected  Vector allFooterElements
           
protected  Vector allHeaderElements
           
protected  Vector defaultFooterElements
           
protected  Vector defaultHeaderElements
           
static String EXCEL_DATA
          Excel Sheet file format, link tables and charts.
static String EXCEL_SHEET
          Excel Sheet file format, do not break the table content.
static String EXCEL2000
          Excel 2000 file format.
static String EXCEL95
          Excel 95 file format.
protected  HashMap formulaMap
           
protected  boolean isHeaderFooterInPageSetup
           
protected  Margin margin
           
static int SINGLECOL_WIDTH
          If export excel with single column, use this as default column width
 
Fields inherited from class inetsoft.report.io.AbstractGenerator
docInfo
 
Constructor Summary
protected ExcelGenerator(OutputStream output)
          Deprecated. replaced by method createExcelGenerator()
protected ExcelGenerator(OutputStream output, String ver)
          Deprecated. replaced by method createExcelGenerator()
 
Method Summary
 void cancel()
          Cancel the generation if one if on going.
static ExcelGenerator createExcelGenerator(OutputStream output)
          Create an excel generator.
static ExcelGenerator createExcelGenerator(OutputStream output, String ver)
          Create an excel generator.
 void generate(Enumeration pages)
          Generate an excel file from a collection of pages.
 void generate(Enumeration pages, boolean removal)
          Generate an excel file from a collection of pages.
 void generate(ReportSheet report)
          Generate an excel file from a report.
 void generate(ReportSheet sheet, Enumeration pages)
          Write a collection of pages to text.
protected  int getBaseH()
          Get baseH.
protected  Margin getMargin()
          Get margin.
 Dimension getPageSize()
          Deprecated. replaced by ReportSheet.getPageSize().
protected  boolean isElementIgnored(ReportElement relem, Rectangle bounds)
          Check if this element will be ignored.
protected  boolean isLandscape()
          Check if the report is langscape.
protected  boolean isPageBreakSupported()
          Whether support auto page break in the excel file.
protected  void setLandscape(boolean landscape)
          set the landscape.
 void setPageSize(Dimension pgsize)
          Deprecated. replaced by ReportSheet.setPageSize().
 
Methods inherited from class inetsoft.report.io.AbstractGenerator
addProgressListener, fireProgressEvent, getCachePages, getOutput, getReportCache, getReportId, removeProgressListener, setDocumentInfo, setOutput, setReportCache, setReportId
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

EXCEL2000

public static final String EXCEL2000
Excel 2000 file format.

See Also:
Constant Field Values

EXCEL95

public static final String EXCEL95
Excel 95 file format.

See Also:
Constant Field Values

EXCEL_SHEET

public static final String EXCEL_SHEET
Excel Sheet file format, do not break the table content.

See Also:
Constant Field Values

EXCEL_DATA

public static final String EXCEL_DATA
Excel Sheet file format, link tables and charts.

See Also:
Constant Field Values

SINGLECOL_WIDTH

public static final int SINGLECOL_WIDTH
If export excel with single column, use this as default column width

See Also:
Constant Field Values

formulaMap

protected HashMap formulaMap

defaultHeaderElements

protected Vector defaultHeaderElements

defaultFooterElements

protected Vector defaultFooterElements

allHeaderElements

protected Vector allHeaderElements

allFooterElements

protected Vector allFooterElements

margin

protected Margin margin

isHeaderFooterInPageSetup

protected boolean isHeaderFooterInPageSetup
Constructor Detail

ExcelGenerator

protected ExcelGenerator(OutputStream output)
Deprecated. replaced by method createExcelGenerator()

Create an excel generator.

Parameters:
output - output stream to write the excel file.

ExcelGenerator

protected ExcelGenerator(OutputStream output,
                         String ver)
Deprecated. replaced by method createExcelGenerator()

Create an excel generator.

Parameters:
output - output stream to write the excel file.
Method Detail

createExcelGenerator

public static ExcelGenerator createExcelGenerator(OutputStream output)
Create an excel generator.

Parameters:
output - output stream to write the excel file.

createExcelGenerator

public static ExcelGenerator createExcelGenerator(OutputStream output,
                                                  String ver)
Create an excel generator.

Parameters:
output - output stream to write the excel file.

getMargin

protected Margin getMargin()
Get margin.


getBaseH

protected int getBaseH()
Get baseH.


isElementIgnored

protected boolean isElementIgnored(ReportElement relem,
                                   Rectangle bounds)
Check if this element will be ignored.


setPageSize

public void setPageSize(Dimension pgsize)
Deprecated. replaced by ReportSheet.setPageSize().

Set the page size for the generated output. This determines how the report is converted to the excel file.

Parameters:
pgsize - page size in points. One inch is 72 points.

getPageSize

public Dimension getPageSize()
Deprecated. replaced by ReportSheet.getPageSize().

Get the page size.


generate

public void generate(ReportSheet sheet,
                     Enumeration pages)
              throws IOException
Write a collection of pages to text.

Throws:
IOException

generate

public void generate(ReportSheet report)
              throws IOException
Generate an excel file from a report.

Parameters:
report - report to export.
Throws:
IOException

generate

public void generate(Enumeration pages)
              throws IOException
Generate an excel file from a collection of pages.

Parameters:
pages - a collection of StylePage objects.
Throws:
IOException

generate

public void generate(Enumeration pages,
                     boolean removal)
              throws IOException
Generate an excel file from a collection of pages.

Parameters:
pages - a collection of StylePage objects.
removal - true if should dispose style pages after generating over.
Throws:
IOException

isPageBreakSupported

protected boolean isPageBreakSupported()
Whether support auto page break in the excel file.


cancel

public void cancel()
Cancel the generation if one if on going.


setLandscape

protected void setLandscape(boolean landscape)
set the landscape.


isLandscape

protected boolean isLandscape()
Check if the report is langscape.


Copyright © 1996-2014 InetSoft Technology Corp. All Rights Reserved.