i-net Clear Reports

com.inet.report
Class SubreportLink

java.lang.Object
  extended by 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

A SubreportLink 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. The PromptField will be generated automatically, so if you want to use your own PromptField add one to the Fields set and use setPromptField method.

This class is part of the RDC.

See Also:
Subreport, Fields.addPromptField(java.lang.String, java.lang.String, int), Engine.setSF(java.lang.String), Serialized Form

Method Summary
 boolean 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.
 Engine 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.
 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 setMainField(Field field)
          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 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.
 
Methods inherited from interface com.inet.report.parser.NodeParser
isDOMParser, parseDOM, parseElement, parseEndElement, parseText
 

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.

getSubEngine

public Engine getSubEngine()
Gets the Engine of the subreport.

Returns:
The Engine object of the sub report of this sub report link.

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.

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 - if true 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.
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.
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.
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.
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.
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.
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 class java.lang.Object
Parameters:
obj - The object to compare with.
Returns:
Returns true if these Objects are equal, else false.

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.

i-net Clear Reports

Copyright © 1999-2011 by i-net software GmbH