jimm.datavision.field
Class SubreportField

java.lang.Object
  extended by java.util.Observable
      extended by jimm.datavision.Element
          extended by jimm.datavision.field.Field
              extended by jimm.datavision.field.SubreportField
All Implemented Interfaces:
java.lang.Cloneable, java.util.Observer, Draggable, Identity, Writeable

public class SubreportField
extends Field

A subreport field represents an entire report within a field. The value of a subreport field holds a report object.

Author:
Jim Menard, jimm@io.com

Field Summary
protected  Subreport subreport
           
 
Fields inherited from class jimm.datavision.field.Field
border, bounds, cache, DEFAULT_HEIGHT, DEFAULT_WIDTH, format, id, maxIdSeen, value
 
Fields inherited from class jimm.datavision.Element
report, section, visible
 
Constructor Summary
SubreportField(java.lang.Long id, Report report, Section section, java.lang.Object value, boolean visible)
          Constructs a text field with the specified id in the specified report section whose text value is value.
 
Method Summary
 java.lang.String dragString()
          Returns the string used to identify a field type when dragging.
 java.lang.String formulaString()
          Returns a string representing the field as it appears in a formula.
 Subreport getSubreport()
           
 java.lang.Object getValue()
          Returns a string containing a line of text for each row returned by the subreport query.
 void setSection(Section s)
          This override adds or removes the subreport from its parent report.
 java.lang.String typeString()
          Returns the string that specifies this field's type in the report XML.
 
Methods inherited from class jimm.datavision.field.Field
canBeAggregated, clone, create, createFromDragString, designLabel, finalize, getBorder, getBorderOrDefault, getBounds, getFormat, getId, getOutputHeight, makeWidget, refersTo, refersTo, refersTo, refersTo, setBorder, setBounds, setFormat, setValue, toString, update, writeFieldGuts, writeXML
 
Methods inherited from class jimm.datavision.Element
getReport, getSection, isVisible, setVisible
 
Methods inherited from class java.util.Observable
addObserver, clearChanged, countObservers, deleteObserver, deleteObservers, hasChanged, notifyObservers, notifyObservers, setChanged
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

subreport

protected Subreport subreport
Constructor Detail

SubreportField

public SubreportField(java.lang.Long id,
                      Report report,
                      Section section,
                      java.lang.Object value,
                      boolean visible)
Constructs a text field with the specified id in the specified report section whose text value is value.

Parameters:
id - the new field's id
report - the report containing this element
section - the report section in which the field resides
value - the id of a subreport
visible - show/hide flag
Method Detail

getSubreport

public Subreport getSubreport()

setSection

public void setSection(Section s)
This override adds or removes the subreport from its parent report. When s is null, the subreport is removed from the report. Doing this prevents the subreport from being output as part of the report when this field has been removed from the report.

Overrides:
setSection in class Element
Parameters:
s - the new section; may be null

getValue

public java.lang.Object getValue()
Returns a string containing a line of text for each row returned by the subreport query.

Overrides:
getValue in class Field
Returns:
a string with newlines separating each row of data

dragString

public java.lang.String dragString()
Description copied from class: Field
Returns the string used to identify a field type when dragging. Usually returns Field.typeString() plus a value or an id.

Specified by:
dragString in interface Draggable
Specified by:
dragString in class Field
Returns:
the string used to identify the field when dragging

typeString

public java.lang.String typeString()
Description copied from class: Field
Returns the string that specifies this field's type in the report XML.

Specified by:
typeString in class Field
Returns:
a string representing this field's type; used in XML files

formulaString

public java.lang.String formulaString()
Description copied from class: Field
Returns a string representing the field as it appears in a formula.

Specified by:
formulaString in class Field
Returns:
a string useful in a formula