Package com.inet.report
Class CrossTabDescriptionSection
- java.lang.Object
-
- com.inet.report.ReportComponent
-
- com.inet.report.CrossTabDescriptionSection
-
- All Implemented Interfaces:
NodeParser
,com.inet.report.ReferenceHolder
,SimpleElementContainer
,java.io.Serializable
public class CrossTabDescriptionSection extends ReportComponent implements SimpleElementContainer
Description section for the Crosstab. It can be used to insert elements into the upper left corner of the crosstab to add some additional information to the crosstab.- Since:
- 6.0
- See Also:
- Serialized Form
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Box
addBox(int boxX, int boxY, int boxWidth, int boxHeight)
Adds a new box to the container and returns it.DatabasePicture
addDatabasePicture(Field field, int pictureX, int pictureY, int pictureWidth, int pictureHeight)
Adds a new DatabasePicture to the container and returns it.FieldElement
addFieldElement(Field field, int fieldX, int fieldY, int fieldWidth, int fieldHeight)
Adds a new FieldElement (a dynamic text element based on aField
) to this container and returns it.Line
addHorizontalLine(int xpos, int ypos, int lineLength)
Adds a new horizontal line to the container and returns it.JavaBean
addJavaBean(java.lang.String className, int beanX, int beanY, int beanWidth, int beanHeight)
Add a new JavaBean to the container.Picture
addPicture(int pictureX, int pictureY, int pictureWidth, int pictureHeight, byte[] buffer)
Adds a new picture element to the container and returns it.Picture
addPicture(int pictureX, int pictureY, int pictureWidth, int pictureHeight, int[] buffer)
Adds a new picture element to the container and returns it.Picture
addPicture(int pictureX, int pictureY, int pictureWidth, int pictureHeight, java.awt.image.BufferedImage im)
Adds a new picture element to the container and returns it.Picture
addPicture(int pictureX, int pictureY, int pictureWidth, int pictureHeight, java.io.File file)
Adds a new picture element to the container and returns it.Picture
addPicture(int pictureX, int pictureY, int pictureWidth, int pictureHeight, java.lang.String fileName)
Adds a new picture element to the container and returns it.Text
addText(int textX, int textY, int textWidth, int textHeight)
Adds a new text element to the container.Line
addVerticalLine(int xpos, int ypos, int lineLength)
Adds a new vertical line to the container and returns it.boolean
contains(Element el)
Tests if the specified element is a component in this section.Element[]
getElements()
Returns an array containing all elements of this container.java.util.Vector<Element>
getElementsV()
Returns a Vector containing all elements in this container.Element
getReportElement(int idx)
Get a report Element.int
getReportElementsCount()
Counts the number of Report Elements in this container and returns it.java.util.List<Element>
getSubComponents()
Returns allReportComponent
s that are descendants of this one.int
getX()
Returns the x position of the left upper corner of the element in the report.int
getY()
Returns the y position of the left upper corner of the element in the report.int
indexOf()
Returns the position of this object in the parent collection.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)
FOR INTERNAL USE ONLY FOR INTERNAL USE ONLY Internal method for reading report XMLvoid
remove(Element elem)
Removes the given report element from the container.void
resetReferences()
FOR INTERNAL USE ONLYvoid
setHeight(int height)
This element can not be resized.void
setReferences()
FOR INTERNAL USE ONLYvoid
setWidth(int width)
This element can not be resized.void
setX(int x)
This element can not be moved.void
setY(int y)
This element can not be moved.-
Methods inherited from class com.inet.report.ReportComponent
addPropertyChangeListener, addPropertyChangeListener, addReferencedObject, addVetoableChangeListener, addVetoableChangeListener, getBackColor, getBackColorFormula, getCustomData, getHeight, getKeepTogetherFormula, getPropertyFormulas, getRealReferencedObjectCount, getReferencedObjectCount, getReferencedObjects, getSuppressFormula, getType, getWidth, isDOMParser, isKeepTogether, isSuppress, paramString, parseDOM, parseEndElement, parseText, removePropertyChangeListener, removePropertyChangeListener, removeReferencedObject, removeVetoableChangeListener, removeVetoableChangeListener, setBackColor, setBackColorFormula, setCustomData, setKeepTogether, setKeepTogetherFormula, setSuppress, setSuppressFormula
-
-
-
-
Method Detail
-
addBox
public Box addBox(int boxX, int boxY, int boxWidth, int boxHeight)
Adds a new box to the container and returns it.- Specified by:
addBox
in interfaceSimpleElementContainer
- Parameters:
boxX
- The horizontal offset in twips.boxY
- The vertical offset in twips.boxWidth
- The width of the box in twips.boxHeight
- The height of the box in twips.- Returns:
- The created box element or
null
if the creation was not successful
-
addFieldElement
public FieldElement addFieldElement(Field field, int fieldX, int fieldY, int fieldWidth, int fieldHeight) throws ReportException
Adds a new FieldElement (a dynamic text element based on aField
) to this container and returns it. Note that for binary fields you need to use the methodSimpleElementContainer.addDatabasePicture(Field, int, int, int, int)
, since picture fields are not FieldElements.- Specified by:
addFieldElement
in interfaceSimpleElementContainer
- Parameters:
field
- The field that should added into container. May not be null.fieldX
- The x-coordinate of the upper left corner in twips.fieldY
- The y-coordinate of the upper left corner in twips.fieldWidth
- The width of the new fieldElement in twips.fieldHeight
- The height of the new fieldElement in twips.- Returns:
- The created FieldElement or
null
if the creation was not successful. - Throws:
ReportException
- if the value type of the field is binary - useSimpleElementContainer.addDatabasePicture(Field, int, int, int, int)
instead.- See Also:
DatabaseField
,FormulaField
,PromptField
,SummaryField
,SQLField
,GroupField
-
addJavaBean
public JavaBean addJavaBean(java.lang.String className, int beanX, int beanY, int beanWidth, int beanHeight) throws ReportException
Add a new JavaBean to the container. The class of the Java Bean need to be extends form java.awt.Component.- Specified by:
addJavaBean
in interfaceSimpleElementContainer
- Parameters:
className
- The class name of the Java Bean.beanX
- The x-coordinate of the upper left corner in twips.beanY
- The y-coordinate of the upper left corner in twips.beanWidth
- The width of the new fieldElement in twips.beanHeight
- The height of the new fieldElement in twips.- Returns:
- The created JavaBean.
- Throws:
ReportException
- if the Java Bean cannot created.
-
addPicture
public Picture addPicture(int pictureX, int pictureY, int pictureWidth, int pictureHeight, java.lang.String fileName) throws ReportException
Adds a new picture element to the container and returns it. If the width or height is -1 then the width and height from the loaded image will be used. Valid formats are GIF, JPG, PNG, BMP, WMF or EMF. Also PDF and HTML files can be added as image if the decoder is installed in the lib directory of i-net Clear Reports.- Specified by:
addPicture
in interfaceSimpleElementContainer
- Parameters:
pictureX
- The horizontal offset of the start point in twips.pictureY
- The vertical offset of the start point in twips.pictureWidth
- The width of the picture in twipspictureHeight
- The height of the picture in twips.fileName
- The absolute or relative to working directory path to the image.- Returns:
- Picture The created report element.
- Throws:
ReportException
- will thrown iffile
is an unknown picture format.- See Also:
SimpleElementContainer.addPicture(int,int,int,int,java.awt.image.BufferedImage)
,SimpleElementContainer.addPicture(int,int,int,int,java.io.File)
,SimpleElementContainer.addPicture(int,int,int,int,byte[])
,SimpleElementContainer.addPicture(int, int, int, int, int[])
-
addPicture
public Picture addPicture(int pictureX, int pictureY, int pictureWidth, int pictureHeight, java.io.File file) throws ReportException
Adds a new picture element to the container and returns it. If the width or height is -1 then the width and height from the loaded image will be used. Valid formats are GIF, JPG, PNG, BMP, WMF or EMF. Also PDF and HTML files can be added as image if the decoder is installed in the lib directory of i-net Clear Reports.- Specified by:
addPicture
in interfaceSimpleElementContainer
- Parameters:
pictureX
- The horizontal offset of the start point in twips.pictureY
- The vertical offset of the start point in twips.pictureWidth
- The width of the picture in twips.pictureHeight
- The height of the picture in twips.file
- The file object to the image.- Returns:
- Picture The created report element.
- Throws:
ReportException
- will thrown iffile
is an unknown picture format.- See Also:
SimpleElementContainer.addPicture(int, int, int, int, BufferedImage)
,SimpleElementContainer.addPicture(int, int, int, int, String)
,SimpleElementContainer.addPicture(int, int, int, int, byte[])
,SimpleElementContainer.addPicture(int, int, int, int, int[])
-
addPicture
public Picture addPicture(int pictureX, int pictureY, int pictureWidth, int pictureHeight, int[] buffer) throws ReportException
Adds a new picture element to the container and returns it. If the width or height is -1 then the width and height from the loaded image will be used. Valid formats are GIF, JPG, PNG, BMP, WMF or EMF. Also PDF and HTML files can be added as image if the decoder is installed in the lib directory of i-net Clear Reports.- Specified by:
addPicture
in interfaceSimpleElementContainer
- Parameters:
pictureX
- The horizontal offset of the start point in twips.pictureY
- The vertical offset of the start point in twips.pictureWidth
- The width of the picture in twips.pictureHeight
- The height of the picture in twips.buffer
- A int[] with image header and data.- Returns:
- Picture The created report element.
- Throws:
ReportException
- ReportException will thrown ifbuffer
is an unknown picture format.- See Also:
SimpleElementContainer.addPicture(int, int, int, int, java.awt.image.BufferedImage)
,SimpleElementContainer.addPicture(int, int, int, int, String)
,SimpleElementContainer.addPicture(int, int, int, int, byte[])
,SimpleElementContainer.addPicture(int, int, int, int, File)
,SimpleElementContainer.addPicture(int,int,int,int,java.io.File)
,SimpleElementContainer.addPicture(int,int,int,int,String)
-
addPicture
public Picture addPicture(int pictureX, int pictureY, int pictureWidth, int pictureHeight, byte[] buffer) throws ReportException
Adds a new picture element to the container and returns it. If the width or height is -1 then the width and height from the loaded image will be used. Valid formats are GIF, JPG, PNG, BMP, WMF or EMF. Also PDF and HTML files can be added as image if the decoder is installed in the lib directory of i-net Clear Reports.- Specified by:
addPicture
in interfaceSimpleElementContainer
- Parameters:
pictureX
- The horizontal offset of the start point in twips.pictureY
- The vertical offset of the start point in twips.pictureWidth
- The width of the picture in twips.pictureHeight
- The height of the picture in twips.buffer
- A byte[] with image header and data.- Returns:
- Picture The created report element.
- Throws:
ReportException
- ReportException will thrown ifbuffer
is an unknown picture format.- See Also:
SimpleElementContainer.addPicture(int,int,int,int,java.awt.image.BufferedImage)
,SimpleElementContainer.addPicture(int, int, int, int, String)
,SimpleElementContainer.addPicture(int,int,int,int,java.io.File)
,SimpleElementContainer.addPicture(int, int, int, int, int[])
-
addPicture
public Picture addPicture(int pictureX, int pictureY, int pictureWidth, int pictureHeight, java.awt.image.BufferedImage im) throws ReportException
Adds a new picture element to the container and returns it. If the width or height is -1 then the width and height from the loaded image will be used. Valid formats are GIF, JPG, PNG, BMP, WMF or EMF. Also PDF and HTML files can be added as image if the decoder is installed in the lib directory of i-net Clear Reports. If the width or height -1 then the width and height from the loaded image is used. The TYPE_INT_ARGB color model is supported only.- Specified by:
addPicture
in interfaceSimpleElementContainer
- Parameters:
pictureX
- The horizontal offset of the start point in twips.pictureY
- The vertical offset of the start point in twips.pictureWidth
- The width of the picture in twips.pictureHeight
- The height of the picture in twips.im
- The image object.- Returns:
- Picture The created report element.
- Throws:
ReportException
- ReportException will thrown ifim
is an unknown picture format.- See Also:
SimpleElementContainer.addPicture(int, int, int, int, String)
,SimpleElementContainer.addPicture(int,int,int,int,java.io.File)
,SimpleElementContainer.addPicture(int,int,int,int,byte[])
,SimpleElementContainer.addPicture(int, int, int, int, int[])
-
addDatabasePicture
public DatabasePicture addDatabasePicture(Field field, int pictureX, int pictureY, int pictureWidth, int pictureHeight)
Adds a new DatabasePicture to the container and returns it.- Specified by:
addDatabasePicture
in interfaceSimpleElementContainer
- Parameters:
field
- Field which value type is Field.BINARY and that should be added to the container. This can be a database field, a formula field, a prompt field or a SQL field.pictureX
- x-coordinate of the upper left corner in twips.pictureY
- y-coordinate of the upper left corner in twips.pictureWidth
- Width of the new fieldElement in twips.pictureHeight
- Height of the new fieldElement in twips.- Returns:
- new created DatabasePicture
-
addText
public Text addText(int textX, int textY, int textWidth, int textHeight)
Adds a new text element to the container. To fill a new line into this text element useaddParagraph
method. The returned text element is empty, that means it contains no paragraph object.- Specified by:
addText
in interfaceSimpleElementContainer
- Parameters:
textX
- the x offset of the text elementtextY
- the y offset of the text elementtextWidth
- the width of the text elementtextHeight
- the height of the text element- Returns:
- the created text element.
-
addHorizontalLine
public Line addHorizontalLine(int xpos, int ypos, int lineLength)
Adds a new horizontal line to the container and returns it.- Specified by:
addHorizontalLine
in interfaceSimpleElementContainer
- Parameters:
xpos
- the horizontal offset of the start point in twips.ypos
- the vertical offset of the start point in twips.lineLength
- the width of the line in twips.- Returns:
- the created line element
-
addVerticalLine
public Line addVerticalLine(int xpos, int ypos, int lineLength)
Adds a new vertical line to the container and returns it.- Specified by:
addVerticalLine
in interfaceSimpleElementContainer
- Parameters:
xpos
- the horizontal offset of the start point in twips.ypos
- the vertical offset of the start point in twips.lineLength
- the height of the line in twips.- Returns:
- the created line element
-
remove
public void remove(Element elem)
Removes the given report element from the container.- Specified by:
remove
in interfaceSimpleElementContainer
- Parameters:
elem
- The Report Element which should be removed from the container (null
is not permitted).
-
getElementsV
public java.util.Vector<Element> getElementsV()
Returns a Vector containing all elements in this container. Each element in the returned Vector is an instance of the class Element or an instance of Element's subclass.- Specified by:
getElementsV
in interfaceSimpleElementContainer
- Returns:
- A Vector containing all elements in this container.
- See Also:
SimpleElementContainer.getElements()
,Element
-
getElements
public Element[] getElements()
Returns an array containing all elements of this container. Each field of the array contains an instance of class Element or an instance of Elements subclass.- Specified by:
getElements
in interfaceSimpleElementContainer
- Returns:
- An array containing all elements in this container.
- See Also:
SimpleElementContainer.getElementsV()
,Element
-
contains
public boolean contains(Element el)
Tests if the specified element is a component in this section.- Parameters:
el
- an element.- Returns:
true
if and only if the specified element is the same as a component in this section, as determined by theequals
method;false
otherwise.- Since:
- 6.0
-
setX
public void setX(int x)
This element can not be moved. Invoking this method will have no effect.- Overrides:
setX
in classReportComponent
- Parameters:
x
- has no effect- Since:
- 6.0
-
setY
public void setY(int y)
This element can not be moved. Invoking this method will have no effect.- Overrides:
setY
in classReportComponent
- Parameters:
y
- has no effect- Since:
- 6.0
-
getX
public int getX()
Returns the x position of the left upper corner of the element in the report. Use the 'object x position' property the adjust the element position from the left side margin. The unit is in twips.- Overrides:
getX
in classReportComponent
- Returns:
- The x position in twips.
-
getY
public int getY()
Returns the y position of the left upper corner of the element in the report. Use the 'object y position' property the adjust the element position from the top margin. The unit is in twips.- Overrides:
getY
in classReportComponent
- Returns:
- The y position in twips.
-
setWidth
public void setWidth(int width)
This element can not be resized. Invoking this method will have no effect. The size of this element depends on the row header width and the column header height.- Overrides:
setWidth
in classReportComponent
- Parameters:
width
- Cannot be set for this element.- Since:
- 6.0
-
setHeight
public void setHeight(int height)
This element can not be resized. Invoking this method will have no effect. The size of this element depends on the row header width and the column header height.- Overrides:
setHeight
in classReportComponent
- Parameters:
height
- Cannot be set for this element.- Since:
- 6.0
-
setReferences
public void setReferences()
FOR INTERNAL USE ONLY- Specified by:
setReferences
in interfacecom.inet.report.ReferenceHolder
- Overrides:
setReferences
in classReportComponent
-
resetReferences
public void resetReferences()
FOR INTERNAL USE ONLY- Specified by:
resetReferences
in interfacecom.inet.report.ReferenceHolder
- Overrides:
resetReferences
in classReportComponent
-
indexOf
public int indexOf() throws ReportException
Returns the position of this object in the parent collection.- Specified by:
indexOf
in classReportComponent
- Returns:
- Position of this object in the parent collection.
- Throws:
ReportException
- If there is no parent or the object does not exist.
-
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 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
- Overrides:
parseElement
in classReportComponent
- 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.
-
getReportElement
public Element getReportElement(int idx)
Get a report Element. You can specify the returned Element with the idx parameter.- Specified by:
getReportElement
in interfaceSimpleElementContainer
- Parameters:
idx
- The 0-based index of the element, which should be returned.- Returns:
- in instance of some subclass of Element.
-
getReportElementsCount
public int getReportElementsCount()
Counts the number of Report Elements in this container and returns it.- Specified by:
getReportElementsCount
in interfaceSimpleElementContainer
- Returns:
- The number of report elements in this container.
-
getSubComponents
public java.util.List<Element> getSubComponents()
Returns allReportComponent
s that are descendants of this one. E.G. this will return all Element of aSection
. But it's as well useful forCrossTab
s orText
elements which have additional elements.- Specified by:
getSubComponents
in classReportComponent
- Returns:
- a list with all sub components which can be empty as well; will be
null
if the component has no descendants
-
-