Style Intelligence v12.0

inetsoft.report.io
Class TemplateFormatter

java.lang.Object
  extended by inetsoft.report.io.BaseFormatter
      extended by inetsoft.report.io.TemplateFormatter
All Implemented Interfaces:
Formatter
Direct Known Subclasses:
ReportFormatter

public class TemplateFormatter
extends BaseFormatter

Converting a report template to XML representation.


Field Summary
protected  boolean embedData
           
protected  boolean keepScript
           
protected  OutputStream output
           
 PrintWriter writer
           
 
Fields inherited from class inetsoft.report.io.BaseFormatter
docInfo, report
 
Constructor Summary
TemplateFormatter(OutputStream output)
          Create a template formatter.
 
Method Summary
 void end()
          Write the end of report.
protected  void endCell()
          End a cell.
protected  void endGrid()
          End the layout grid.
 void endHeader()
          End a header section.
protected  void endRow()
          End a row.
protected  String getType(ReportSheet sheet)
          Get the type name of a ReportSheet.
protected  boolean isKeepScript()
          check if scripts associated with reports and elements will be saved.
protected  void localize(ReportSheet report)
          Localize the report.
protected  void prepare(ReportSheet sheet)
          Prepare the report for exporting to xml.
 void prolog(ReportSheet sheet)
          Write the prolog of report.
protected  void setKeepScript(boolean v)
          set whether scripts associated with reports and elements will be saved.
protected  void startCell(TabularSheet sheet, int r, int c, Object bg, Insets borders, Color bcolor, Rectangle span, String width, boolean repeat)
          Start a new cell.
protected  void startGrid(int rows, int cols)
          Start a layout grid (for tabular layout).
 void startHeader(int type)
          Start a header section.
 void startHeader(String eid, boolean header)
          Start a header selection for element associated header/footer.
protected  void startRow(TabularSheet sheet, int row)
          Start a new row.
protected static String toString(Object obj)
           
 void write(AreaBreakElement elem)
          Write the areabreak element.
 void write(BeanElement elem)
          Write the bean element.
 void write(ChartElement elem)
          Write the chart element.
 void write(CompositeElement elem)
          Write the composite element.
 void write(CondPageBreakElement elem)
          Write the conditional page break element.
 void write(EditRegionElement elem)
          Write the edit region element.
 void write(FormElement elem)
          Write the form element.
protected  void write(FormLens table)
          Write a table data.
 void write(HeadingElement elem)
          Write the heading text element.
protected  void write(Image buf, Dimension d)
          Write an image object.
 void write(NewlineElement elem)
          Write the newline element.
 void write(PageBreakElement elem)
          Write the pagebreak element.
 void write(PageLayoutElement elem)
          Write the page layout element.
 void write(PainterElement elem)
          Write the painter element.
protected  void write(Painter painter, ReportElement elem)
          Write an embedded image (painter) object.
 void write(ParameterElement elem)
          Write the parameter element.
 void write(ReportElement elem)
          Write one element.
 void write(ReportSheet sheet)
          Export a report.
 void write(SectionElement elem)
          Write the section element.
 void write(SeparatorElement elem)
          Write the separator element.
 void write(SpaceElement elem)
          Write the space element.
protected  void write(SubreportElement subreport)
          Write a subreport.
 void write(TabElement elem)
          Write the tab element.
 void write(TableElement elem)
          Write the table element.
protected  void write(TableLens table)
          Write a table data.
 void write(TextBoxElement elem)
          Write the textbox element.
 void write(TextElement elem)
          Write the text element.
 void write(TOCElement elem)
          Write the TOC element.
 void write(inetsoft.report.style.XTableStyle style)
          Write embedded table style.
protected  void writeBeanPropertyDefinition(String prop, BeanPropertyDefinition map)
          Write a bean mapping definition.
protected  void writeBindingAttr(inetsoft.report.internal.BindableElement elem, boolean rewriting)
          Write binding attr.
protected  void writeContents(StyleSheet sheet)
          Export a report.
protected  void writeContents(TabularSheet sheet)
          Export a TabularSheet report.
protected  void writeElementAttributes(ReportElement elem0)
          Write the common attributes of elements.
protected  void writeElementProperties(ReportElement elem0)
          Write the properties of elements.
protected  void writeHiddenFields(inetsoft.report.internal.FieldElementDef elem)
          Write hidden fields attr for field element
 void writeHyperlink(PrintWriter writer, Hyperlink link)
          Writer the hyperlink to XML.
protected  void writePageAreas(PageArea[] as)
          Write the page area specifications.
protected  void writePainterAttributes(PainterElement elem)
          Write the painter attributes.
protected  void writePropertyValue(PrintWriter writer, String prop, Object value)
          Write tags for a property value.
protected  void writeSection(SectionLens section)
          Write the section specifications.
protected  void writeSectionBand(SectionBand band)
          Write the section band contents.
protected  void writeSectionBands(SectionBand[] bands)
          Write the section band contents.
protected  void writeShapes(PageLayout.Shape[] shapes)
          Write the pagelayout shapes specifications.
protected  void writeTabAttributes(inetsoft.report.internal.TabSupport elem)
          Write the tab attributes.
 
Methods inherited from class inetsoft.report.io.BaseFormatter
addProgressListener, escape, fireProgressEvent, init, removeProgressListener, setDocumentInfo, writeContents, writeElementContents, writeSection, writeWarnings, writeWarnings
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

keepScript

protected boolean keepScript

embedData

protected boolean embedData

writer

public PrintWriter writer

output

protected OutputStream output
Constructor Detail

TemplateFormatter

public TemplateFormatter(OutputStream output)
Create a template formatter.

Method Detail

write

public void write(ReportSheet sheet)
           throws IOException
Export a report.

Specified by:
write in interface Formatter
Overrides:
write in class BaseFormatter
Parameters:
sheet - report to export.
Throws:
IOException

localize

protected void localize(ReportSheet report)
Localize the report.

Overrides:
localize in class BaseFormatter

prepare

protected void prepare(ReportSheet sheet)
Prepare the report for exporting to xml.


setKeepScript

protected void setKeepScript(boolean v)
set whether scripts associated with reports and elements will be saved.


isKeepScript

protected boolean isKeepScript()
check if scripts associated with reports and elements will be saved.


startGrid

protected void startGrid(int rows,
                         int cols)
Start a layout grid (for tabular layout).

Specified by:
startGrid in class BaseFormatter
Parameters:
rows - number of rows.
cols - number of columns.

endGrid

protected void endGrid()
End the layout grid.

Specified by:
endGrid in class BaseFormatter

startRow

protected void startRow(TabularSheet sheet,
                        int row)
Start a new row.

Specified by:
startRow in class BaseFormatter
Parameters:
sheet - tabular report object.
row - row index in the grid.

endRow

protected void endRow()
End a row.

Specified by:
endRow in class BaseFormatter

startCell

protected void startCell(TabularSheet sheet,
                         int r,
                         int c,
                         Object bg,
                         Insets borders,
                         Color bcolor,
                         Rectangle span,
                         String width,
                         boolean repeat)
Start a new cell.

Specified by:
startCell in class BaseFormatter
r - row index.
c - column index.
bg - cell background color or image.
borders - border setting.
bcolor - border color.
span - cell span.
width - column width. See TabularSheet for width specification format.
repeat - true to repeat the cell contents on every page.

endCell

protected void endCell()
End a cell.

Specified by:
endCell in class BaseFormatter

writeContents

protected void writeContents(StyleSheet sheet)
                      throws IOException
Export a report.

Overrides:
writeContents in class BaseFormatter
Parameters:
sheet - report to export.
Throws:
IOException

writeContents

protected void writeContents(TabularSheet sheet)
                      throws IOException
Export a TabularSheet report.

Overrides:
writeContents in class BaseFormatter
Throws:
IOException

prolog

public void prolog(ReportSheet sheet)
Write the prolog of report.


startHeader

public void startHeader(int type)
Start a header section.

Parameters:
type - header/footer type. Defined in StyleSheet.

startHeader

public void startHeader(String eid,
                        boolean header)
Start a header selection for element associated header/footer.

Parameters:
eid - element ID.
header - true if header, false if footer.

endHeader

public void endHeader()
End a header section.


write

public void write(ReportElement elem)
           throws IOException
Write one element.

Overrides:
write in class BaseFormatter
Parameters:
elem - report element.
Throws:
IOException

write

public void write(inetsoft.report.style.XTableStyle style)
Write embedded table style.


write

public void write(TextElement elem)
Write the text element.


write

public void write(HeadingElement elem)
Write the heading text element.


write

public void write(TableElement elem)
Write the table element.


write

public void write(FormElement elem)
Write the form element.


write

public void write(PainterElement elem)
Write the painter element.


write

public void write(ChartElement elem)
Description copied from interface: Formatter
Write the chart element.


write

public void write(TextBoxElement elem)
Write the textbox element.


write

public void write(TabElement elem)
Write the tab element.


writeTabAttributes

protected void writeTabAttributes(inetsoft.report.internal.TabSupport elem)
Write the tab attributes.


write

public void write(NewlineElement elem)
Write the newline element.


write

public void write(AreaBreakElement elem)
Write the areabreak element.


write

public void write(PageBreakElement elem)
Write the pagebreak element.


write

public void write(SectionElement elem)
           throws IOException
Write the section element.

Throws:
IOException

writeSection

protected void writeSection(SectionLens section)
                     throws IOException
Write the section specifications.

Throws:
IOException

writeSectionBands

protected void writeSectionBands(SectionBand[] bands)
                          throws IOException
Write the section band contents.

Throws:
IOException

writeSectionBand

protected void writeSectionBand(SectionBand band)
                         throws IOException
Write the section band contents.

Specified by:
writeSectionBand in class BaseFormatter
Throws:
IOException

write

public void write(PageLayoutElement elem)
           throws IOException
Write the page layout element.

Throws:
IOException

writePageAreas

protected void writePageAreas(PageArea[] as)
                       throws IOException
Write the page area specifications.

Throws:
IOException

writeShapes

protected void writeShapes(PageLayout.Shape[] shapes)
Write the pagelayout shapes specifications.

Specified by:
writeShapes in class BaseFormatter

write

public void write(CondPageBreakElement elem)
Write the conditional page break element.


write

public void write(SpaceElement elem)
Write the space element.


write

public void write(SeparatorElement elem)
Write the separator element.


write

protected void write(SubreportElement subreport)
              throws IOException
Write a subreport.

Overrides:
write in class BaseFormatter
Throws:
IOException

write

public void write(TOCElement elem)
           throws IOException
Write the TOC element.

Throws:
IOException

write

public void write(CompositeElement elem)
           throws IOException
Write the composite element.

Throws:
IOException

write

public void write(EditRegionElement elem)
           throws IOException
Write the edit region element.

Throws:
IOException

write

public void write(BeanElement elem)
           throws IOException
Write the bean element.

Throws:
IOException

write

public void write(ParameterElement elem)
           throws IOException
Write the parameter element.

Specified by:
write in interface Formatter
Overrides:
write in class BaseFormatter
Throws:
IOException

end

public void end()
Write the end of report.

Specified by:
end in interface Formatter
Specified by:
end in class BaseFormatter

writeElementAttributes

protected void writeElementAttributes(ReportElement elem0)
Write the common attributes of elements.


writeElementProperties

protected void writeElementProperties(ReportElement elem0)
Write the properties of elements.


writePainterAttributes

protected void writePainterAttributes(PainterElement elem)
Write the painter attributes.


writeBindingAttr

protected void writeBindingAttr(inetsoft.report.internal.BindableElement elem,
                                boolean rewriting)
Write binding attr.


writeHiddenFields

protected void writeHiddenFields(inetsoft.report.internal.FieldElementDef elem)
Write hidden fields attr for field element


write

protected void write(TableLens table)
Write a table data. Attributes are not written to output.


write

protected void write(FormLens table)
Write a table data. Attributes are not written to output.


write

protected void write(Painter painter,
                     ReportElement elem)
Write an embedded image (painter) object.


write

protected void write(Image buf,
                     Dimension d)
Write an image object.


writePropertyValue

protected void writePropertyValue(PrintWriter writer,
                                  String prop,
                                  Object value)
Write tags for a property value.


writeBeanPropertyDefinition

protected void writeBeanPropertyDefinition(String prop,
                                           BeanPropertyDefinition map)
Write a bean mapping definition.

Overrides:
writeBeanPropertyDefinition in class BaseFormatter

writeHyperlink

public void writeHyperlink(PrintWriter writer,
                           Hyperlink link)
Writer the hyperlink to XML.


getType

protected String getType(ReportSheet sheet)
Get the type name of a ReportSheet.


toString

protected static String toString(Object obj)

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