Class FieldElement

All Implemented Interfaces:
BorderProperties, FontProperties, GeneralProperties, HyperlinkProperties, ParagraphProperties, NodeParser, com.inet.report.ReferenceHolder, TextInterpretationProperties, TextProperties, ValueProperties, Serializable, Cloneable

public class FieldElement extends AbstractValueElement implements ParagraphProperties, TextProperties, TextInterpretationProperties, com.inet.report.ReferenceHolder, HyperlinkProperties, BorderProperties
A FieldElement is an object like a label but the content of it comes dynamically from a field, i.e. a DatabaseField, FormulaField, PromptField etc. With this class you can add a dynamic content into a section of your report. Add an instance of this class with method Section.addFieldElement(Field, int, int, int, int) in class Section. If you want to insert a field into a Text using this class is wrong, use FieldPart.

code example: adding a dynamic content to the detail section

   Fields fields = engine.getFields();
   Area area = engine.getArea("D");
   Section section = area.getSection(0);
   FieldElement fElem = section.addFieldElement(fields.getDatabaseField(0),0,0,1000,220);
  
code example: get existing FieldElements and change the property color

   Area area = engine.getArea("D");
   Section section = area.getSection(0);
   Vector elementsV = section.getElementsV();
   for(int i=0;i< elementsV.size();i++){
    Element elem = (Element)elementsV.elementAt(i);
    if(elem instanceof FieldElement){
     FieldElement fElem = (FieldElement)elem;
     fElem.setFontColor(CoderXML.COLOR_RED);
    }
   }
  
If you need a destined FieldElement you have to check some properties, to be sure having the right one.
Note that the properties for number and currency formats does not take effect when the property 'use system default format' is set. Changes at properties for date/time/datetime does not take effect when the property 'date windows default type' is set to a short or long default format.

This class is part of the RDC.
Since:
6.0
See Also: