Package com.inet.report
Class SubreportLink
- java.lang.Object
-
- com.inet.report.SubreportLink
-
- All Implemented Interfaces:
NodeParser
,com.inet.report.ReferenceHolder
,java.io.Serializable
public class SubreportLink extends java.lang.Object implements java.io.Serializable, com.inet.report.ReferenceHolder, NodeParser
ASubreportLink
object links a field in main report with a field in subreport with use of a prompt field in the subreport. The values of the field in main report will used as prompt values in the subreport. These prompt values will be used in the record selection formula to compare with the values of the field in the subreport. ThePromptField
will be generated automatically, so if you want to use your ownPromptField
add one to theFields
set and usesetPromptField
method.
This class is part of the RDC.
-
-
Field Summary
Fields Modifier and Type Field Description static int
SUBFIELD
FOR INTERNAL USE ONLYstatic java.lang.String
SUBFIELD_SYMBOL
FOR INTERNAL USE ONLYstatic int
SUBFIELD_TYPE
FOR INTERNAL USE ONLYstatic java.lang.String
SUBFIELD_TYPE_SYMBOL
FOR INTERNAL USE ONLY
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addReferencedObject(com.inet.report.ReferencedObject reference)
FOR INTERNAL USE ONLYboolean
equals(java.lang.Object obj)
Compares two SubreportLink objects for equality.Engine
getMainEngine()
Gets the main Engine to which the subreport is linked.Field
getMainField()
Gets the Field to that the field in subreport is linked.PromptField
getPromptField()
Returns the PromptField of the subreport, that is linked with the DatabaseField from the main report.int
getRealReferencedObjectCount()
FOR INTERNAL USE ONLYint
getReferencedObjectCount()
FOR INTERNAL USE ONLYcom.inet.report.ReferencedObject[]
getReferencedObjects()
FOR INTERNAL USE ONLYEngine
getSubEngine()
Gets the Engine of the subreport.Field
getSubField()
Returns the field in the subreport, that is used to compare with the value of the links PromptField in the record selection formula.int
indexOf()
Returns the index of this subreport link in the list of subreport links of the subreport.boolean
isDOMParser()
FOR INTERNAL USE ONLY Internal method for reading report XMLvoid
parseDOM(org.w3c.dom.Node node, java.util.Map<java.lang.String,java.lang.Object> parserMap)
FOR INTERNAL USE ONLY Internal method for reading report XMLNodeParser
parseElement(com.inet.report.parser.XMLTag group, java.lang.String tag, org.xml.sax.Attributes atts, java.util.Map<java.lang.String,java.lang.Object> parserMap)
FOR INTERNAL USE ONLY Internal method for reading report XMLvoid
parseEndElement(com.inet.report.parser.XMLTag group, java.lang.String tag, java.util.Map<java.lang.String,java.lang.Object> parserMap)
FOR INTERNAL USE ONLY Internal method for reading report XMLvoid
parseText(java.lang.String text, java.util.Map<java.lang.String,java.lang.Object> parserMap)
FOR INTERNAL USE ONLY Internal method for reading report XMLvoid
removeReferencedObject(com.inet.report.ReferencedObject reference)
FOR INTERNAL USE ONLYvoid
resetReferences()
FOR INTERNAL USE ONLYvoid
setMainField(Field field)
Sets the field in the mainreport that value will be used to set the value of the PromptField in the subreport.PromptField
setMainField(Field field, boolean generatePrompt)
Sets the Field in the mainreport that value will be used to set the value of the PromptField in the subreport.void
setPromptField(PromptField p)
Set the PromptField of the subreport, that is linked with the DatabaseField from the main report.void
setReferences()
FOR INTERNAL USE ONLYvoid
setSubField(Field field)
Sets the Field in the subreport, that is used to compare with the value of the links PromptField in the record selection formula.
-
-
-
Field Detail
-
SUBFIELD_SYMBOL
public static final java.lang.String SUBFIELD_SYMBOL
FOR INTERNAL USE ONLY- See Also:
- Constant Field Values
-
SUBFIELD
public static final int SUBFIELD
FOR INTERNAL USE ONLY- See Also:
- Constant Field Values
-
SUBFIELD_TYPE_SYMBOL
public static final java.lang.String SUBFIELD_TYPE_SYMBOL
FOR INTERNAL USE ONLY- See Also:
- Constant Field Values
-
SUBFIELD_TYPE
public static final int SUBFIELD_TYPE
FOR INTERNAL USE ONLY- See Also:
- Constant Field Values
-
-
Method Detail
-
getMainEngine
public Engine getMainEngine()
Gets the main Engine to which the subreport is linked.- Returns:
- The Engine object of the main report of this sub report link.
- Since:
- 6.0
-
getSubEngine
public Engine getSubEngine()
Gets the Engine of the subreport.- Returns:
- The Engine object of the sub report of this sub report link.
- Since:
- 6.0
-
getMainField
public Field getMainField()
Gets the Field to that the field in subreport is linked.- Returns:
- The Field that values are used for the subreports PromptField.
- Since:
- 6.0
-
setMainField
public PromptField setMainField(Field field, boolean generatePrompt) throws ReportException
Sets the Field in the mainreport that value will be used to set the value of the PromptField in the subreport. A new prompt field for the subreport will be generated.- Parameters:
field
- The Field that gives the values for the subreports PromptField.generatePrompt
- iftrue
an prompt will be automatically generated if neccessary.- Returns:
- the prompt field used by this link
- Throws:
ReportException
- If the generation of the prompt field for the sub report failed.java.lang.IllegalArgumentException
- If the given field doesnt exist in main report.- Since:
- 6.0
- See Also:
DatabaseField
-
setMainField
public void setMainField(Field field) throws ReportException
Sets the field in the mainreport that value will be used to set the value of the PromptField in the subreport. A new prompt field for the subreport will be generated. An update of the record selection formula of the subreport is performed.- Parameters:
field
- The Field that gives the values for the subreports PromptField.- Throws:
ReportException
- If the generation of the prompt field for the sub report failed.- Since:
- 6.0
- See Also:
DatabaseField
-
setSubField
public void setSubField(Field field)
Sets the Field in the subreport, that is used to compare with the value of the links PromptField in the record selection formula. An update of the record selection formula of the subreport is performed.- Parameters:
field
- - The field to compare with.- Since:
- 6.0
- See Also:
DatabaseField
,PromptField
,FormulaField
,SQLField
,setPromptField(PromptField)
-
getSubField
public Field getSubField() throws ReportException
Returns the field in the subreport, that is used to compare with the value of the links PromptField in the record selection formula.- Returns:
- The field to compare with prompt fields value.
- Throws:
ReportException
- If this sub report link is invalid.- Since:
- 6.0
- See Also:
DatabaseField
,PromptField
,FormulaField
,SQLField
,getPromptField()
-
setPromptField
public void setPromptField(PromptField p)
Set the PromptField of the subreport, that is linked with the DatabaseField from the main report. An update of the record selection formula of the subreport is performed.- Parameters:
p
- The new prompt field which should be used for this subreport link.- Since:
- 7.0
- See Also:
PromptField
-
getPromptField
public PromptField getPromptField()
Returns the PromptField of the subreport, that is linked with the DatabaseField from the main report.- Returns:
- The PromptField of this link.
- Since:
- 7.0
- See Also:
PromptField
-
equals
public boolean equals(java.lang.Object obj)
Compares two SubreportLink objects for equality. Returns a boolean that indicates whether the SubreportLink object is equivalent to the specified object.- Overrides:
equals
in classjava.lang.Object
- Parameters:
obj
- The object to compare with.- Returns:
- Returns true if these Objects are equal, else false.
- Since:
- 6.0
-
indexOf
public int indexOf()
Returns the index of this subreport link in the list of subreport links of the subreport.- Returns:
- The index of this sub report link or -1 if this sub report link is not valid anymore.
- Since:
- 6.0
-
addReferencedObject
public final void addReferencedObject(com.inet.report.ReferencedObject reference)
FOR INTERNAL USE ONLY- Specified by:
addReferencedObject
in interfacecom.inet.report.ReferenceHolder
- Since:
- 6.0
-
removeReferencedObject
public final void removeReferencedObject(com.inet.report.ReferencedObject reference)
FOR INTERNAL USE ONLY- Specified by:
removeReferencedObject
in interfacecom.inet.report.ReferenceHolder
- Since:
- 6.0
-
getRealReferencedObjectCount
public final int getRealReferencedObjectCount()
FOR INTERNAL USE ONLY- Specified by:
getRealReferencedObjectCount
in interfacecom.inet.report.ReferenceHolder
- Since:
- 6.0
-
getReferencedObjectCount
public final int getReferencedObjectCount()
FOR INTERNAL USE ONLY- Specified by:
getReferencedObjectCount
in interfacecom.inet.report.ReferenceHolder
-
getReferencedObjects
public final com.inet.report.ReferencedObject[] getReferencedObjects()
FOR INTERNAL USE ONLY- Specified by:
getReferencedObjects
in interfacecom.inet.report.ReferenceHolder
-
resetReferences
public final void resetReferences()
FOR INTERNAL USE ONLY- Specified by:
resetReferences
in interfacecom.inet.report.ReferenceHolder
-
setReferences
public final void setReferences()
FOR INTERNAL USE ONLY- Specified by:
setReferences
in interfacecom.inet.report.ReferenceHolder
-
isDOMParser
public boolean isDOMParser()
FOR INTERNAL USE ONLY Internal method for reading report XMLReturns whether this node is to be read via a DOM parser.
- Specified by:
isDOMParser
in interfaceNodeParser
- Returns:
- true if this node is to be read via a DOM parser, false otherwise.
-
parseDOM
public void parseDOM(org.w3c.dom.Node node, java.util.Map<java.lang.String,java.lang.Object> parserMap) throws FatalParserException
FOR INTERNAL USE ONLY Internal method for reading report XMLParses the node.
- Specified by:
parseDOM
in interfaceNodeParser
- Parameters:
node
- the nodeparserMap
- The map of current Parser.- Throws:
FatalParserException
- if an exception occurs which causes the report to not be able to be read: causes the abortion of the reading of the report.
-
parseElement
public NodeParser parseElement(com.inet.report.parser.XMLTag group, java.lang.String tag, org.xml.sax.Attributes atts, java.util.Map<java.lang.String,java.lang.Object> parserMap) throws FatalParserException
FOR INTERNAL USE ONLY Internal method for reading report XMLParses an XML node with the given information, and returns either a sub-element which was created as a result, or null if no sub-element was created, i.e. the information was applied to the ReportComponent itself. Note that the parsing is highly tolerant, i.e. exceptions are intercepted and suppressed if at all possible.
- Specified by:
parseElement
in interfaceNodeParser
- Parameters:
group
- XMLTag of the current node to be parsed, or null if there is no such current group. An XMLTag is a group of nodes bundled together, usually it is a Properties node such as CommonProperties, BorderProperties, etc.tag
- The XMLTag to be parsedatts
- The set of attributes in the current XMLTagparserMap
- The map of current Parser.- Returns:
- The NodeParser sub-element if one needed to be created, or null if none was created.
- Throws:
FatalParserException
- if an exception occurs which causes the report to not be able to be read: causes the abortion of the reading of the report.
-
parseEndElement
public void parseEndElement(com.inet.report.parser.XMLTag group, java.lang.String tag, java.util.Map<java.lang.String,java.lang.Object> parserMap) throws FatalParserException
FOR INTERNAL USE ONLY Internal method for reading report XMLReceive notification of the end of an XML tag.
- Specified by:
parseEndElement
in interfaceNodeParser
- Parameters:
group
- XMLTag of the current node to be parsed, or null if there is no such current group.tag
- The XMLTag to be parsedparserMap
- The map of current Parser.- Throws:
FatalParserException
- if an exception occurs which causes the report to not be able to be read: causes the abortion of the reading of the report.
-
parseText
public void parseText(java.lang.String text, java.util.Map<java.lang.String,java.lang.Object> parserMap)
FOR INTERNAL USE ONLY Internal method for reading report XMLThis method is called if text was encountered in the context of this node. (Examples would be a formula's text or a text element's text)
- Specified by:
parseText
in interfaceNodeParser
- Parameters:
text
- text encountered and to be storedparserMap
- The map of current Parser.
-
-