Package net.sf.jasperreports.export
Class ReadOnlyPartJasperPrint
- java.lang.Object
-
- net.sf.jasperreports.engine.JasperPrint
-
- net.sf.jasperreports.export.ReadOnlyPartJasperPrint
-
- All Implemented Interfaces:
Serializable
,JRChangeEventsSupport
,JRPropertiesHolder
public class ReadOnlyPartJasperPrint extends JasperPrint
- Author:
- Teodor Danciu (teodord@users.sourceforge.net)
- See Also:
- Serialized Form
-
-
Field Summary
-
Fields inherited from class net.sf.jasperreports.engine.JasperPrint
EXCEPTION_MESSAGE_KEY_DUPLICATE_STYLE, PROPERTIES_PRINT_TRANSFER_PREFIX, PROPERTY_BOOKMARKS, PROPERTY_BOTTOM_MARGIN, PROPERTY_COLLAPSE_MISSING_BOOKMARK_LEVELS, PROPERTY_CREATE_BOOKMARKS, PROPERTY_FORMAT_FACTORY_CLASS, PROPERTY_LEFT_MARGIN, PROPERTY_LOCALE_CODE, PROPERTY_NAME, PROPERTY_ORIENTATION, PROPERTY_ORIGINS, PROPERTY_PAGE_HEIGHT, PROPERTY_PAGE_WIDTH, PROPERTY_PAGES, PROPERTY_PARTS, PROPERTY_RIGHT_MARGIN, PROPERTY_STYLES, PROPERTY_TIME_ZONE_ID, PROPERTY_TOP_MARGIN
-
-
Constructor Summary
Constructors Constructor Description ReadOnlyPartJasperPrint(JasperPrint jasperPrint, PrintPart part, int startPageIndex, int endPageIndex)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addBookmark(PrintBookmark bookmark)
Adds a new page to the document.void
addOrigin(JROrigin origin)
Adds a new style to the report origins.void
addPage(int index, JRPrintPage page)
Adds a new page to the document, placing it at the specified index.void
addPage(JRPrintPage page)
Adds a new page to the document.void
addPart(int pageIndex, PrintPart part)
Adds a new part to the document.void
addStyle(JRStyle style)
Adds a new style to the report styles.void
addStyle(JRStyle style, boolean isIgnoreDuplicate)
Adds a new style to the report styles.Map<String,JRPrintAnchorIndex>
getAnchorIndexes()
List<PrintBookmark>
getBookmarks()
Integer
getBottomMargin()
JRStyle
getDefaultStyle()
Returns the default report style.JRDefaultStyleProvider
getDefaultStyleProvider()
When we want to virtualize pages, we want a style provider that is not the print object itself.String
getFormatFactoryClass()
Returns the name of the class implementing theFormatFactory
interface to use with this document.Integer
getLeftMargin()
String
getLocaleCode()
Returns the code of the defaultjava.util.Locale
to be used for the elements of this print object.String
getName()
OrientationEnum
getOrientation()
Returns the page orientation.JROrigin[]
getOrigins()
Gets an array of report origins.List<JROrigin>
getOriginsList()
Gets a list of report origins.Map<JROrigin,Integer>
getOriginsMap()
Gets a map of report origins.int
getPageHeight()
List<JRPrintPage>
getPages()
Returns a list of all pages in the filled report.int
getPageWidth()
JRPropertiesHolder
getParentProperties()
Returns the parent properties holder, whose properties are used as defaults for this object.PrintParts
getParts()
Returns a list of all parts in the filled report.JRPropertiesMap
getPropertiesMap()
Returns this object's properties map.String
getProperty(String propName)
String[]
getPropertyNames()
Integer
getRightMargin()
JRStyle[]
getStyles()
Gets an array of report styles.List<JRStyle>
getStylesList()
Gets a list of report styles.Map<String,JRStyle>
getStylesMap()
Gets a map of report styles.String
getTimeZoneId()
Returns theID
of the defaultjava.util.TimeZone
to be used for the elements of this print object.Integer
getTopMargin()
boolean
hasProperties()
Checks whether the object has any properties.JROrigin
removeOrigin(JROrigin origin)
JRPrintPage
removePage(int index)
Removes a page from the document.PrintPart
removePart(int pageIndex)
Removes a part from the document.void
removeProperty(String propName)
JRStyle
removeStyle(String styleName)
JRStyle
removeStyle(JRStyle style)
void
setBookmarks(List<PrintBookmark> bookmarks)
void
setBottomMargin(Integer bottomMargin)
Sets the bottom page margin.void
setDefaultStyle(JRStyle style)
Sets the default report style.void
setFormatFactoryClass(String formatFactoryClass)
Sets the name of the class implementing theFormatFactory
interface to use with this document.void
setLeftMargin(Integer leftMargin)
Sets the left page margin.void
setLocaleCode(String localeCode)
Sets the the code of the defaultjava.util.Locale
to be used for this object.void
setName(String name)
Sets the name of the document.void
setOrientation(OrientationEnum orientation)
Sets the page orientation.void
setPageHeight(int pageHeight)
Sets the page height.void
setPageWidth(int pageWidth)
Sets the page width.void
setProperty(String propName, String value)
void
setRightMargin(Integer rightMargin)
Sets the right page margin.void
setTimeZoneId(String timeZoneId)
Sets the theID
of the defaultjava.util.TimeZone
to be used for this object.void
setTopMargin(Integer topMargin)
Sets the top page margin.-
Methods inherited from class net.sf.jasperreports.engine.JasperPrint
collectAnchors, copyFrom, getEventSupport, getPageFormat, getPageFormat, hasEventSupport, hasParts, setJasperReportsContext
-
-
-
-
Constructor Detail
-
ReadOnlyPartJasperPrint
public ReadOnlyPartJasperPrint(JasperPrint jasperPrint, PrintPart part, int startPageIndex, int endPageIndex)
-
-
Method Detail
-
getName
public String getName()
- Overrides:
getName
in classJasperPrint
- Returns:
- Returns the name of the document
-
setName
public void setName(String name)
Description copied from class:JasperPrint
Sets the name of the document.- Overrides:
setName
in classJasperPrint
- Parameters:
name
- name of the document
-
getPageWidth
public int getPageWidth()
- Overrides:
getPageWidth
in classJasperPrint
- Returns:
- Returns the page width
-
setPageWidth
public void setPageWidth(int pageWidth)
Description copied from class:JasperPrint
Sets the page width.- Overrides:
setPageWidth
in classJasperPrint
- Parameters:
pageWidth
- page width
-
getPageHeight
public int getPageHeight()
- Overrides:
getPageHeight
in classJasperPrint
- Returns:
- Returns the page height.
-
setPageHeight
public void setPageHeight(int pageHeight)
Description copied from class:JasperPrint
Sets the page height.- Overrides:
setPageHeight
in classJasperPrint
- Parameters:
pageHeight
- page height
-
getTopMargin
public Integer getTopMargin()
- Overrides:
getTopMargin
in classJasperPrint
- Returns:
- Returns the top page margin
-
setTopMargin
public void setTopMargin(Integer topMargin)
Description copied from class:JasperPrint
Sets the top page margin.- Overrides:
setTopMargin
in classJasperPrint
- Parameters:
topMargin
- top page margin
-
getLeftMargin
public Integer getLeftMargin()
- Overrides:
getLeftMargin
in classJasperPrint
- Returns:
- Returns the left page margin
-
setLeftMargin
public void setLeftMargin(Integer leftMargin)
Description copied from class:JasperPrint
Sets the left page margin.- Overrides:
setLeftMargin
in classJasperPrint
- Parameters:
leftMargin
- left page margin
-
getBottomMargin
public Integer getBottomMargin()
- Overrides:
getBottomMargin
in classJasperPrint
- Returns:
- Returns the bottom page margin
-
setBottomMargin
public void setBottomMargin(Integer bottomMargin)
Description copied from class:JasperPrint
Sets the bottom page margin.- Overrides:
setBottomMargin
in classJasperPrint
- Parameters:
bottomMargin
- bottom page margin
-
getRightMargin
public Integer getRightMargin()
- Overrides:
getRightMargin
in classJasperPrint
- Returns:
- Returns the right page margin
-
setRightMargin
public void setRightMargin(Integer rightMargin)
Description copied from class:JasperPrint
Sets the right page margin.- Overrides:
setRightMargin
in classJasperPrint
- Parameters:
rightMargin
- right page margin
-
getOrientation
public OrientationEnum getOrientation()
Description copied from class:JasperPrint
Returns the page orientation.- Overrides:
getOrientation
in classJasperPrint
- See Also:
PORTRAIT,
,LANDSCAPE
-
setOrientation
public void setOrientation(OrientationEnum orientation)
Description copied from class:JasperPrint
Sets the page orientation.- Overrides:
setOrientation
in classJasperPrint
- See Also:
PORTRAIT,
,LANDSCAPE
-
hasProperties
public boolean hasProperties()
Description copied from interface:JRPropertiesHolder
Checks whether the object has any properties.- Specified by:
hasProperties
in interfaceJRPropertiesHolder
- Overrides:
hasProperties
in classJasperPrint
- Returns:
- whether the object has any properties
-
getPropertiesMap
public JRPropertiesMap getPropertiesMap()
Description copied from interface:JRPropertiesHolder
Returns this object's properties map.- Specified by:
getPropertiesMap
in interfaceJRPropertiesHolder
- Overrides:
getPropertiesMap
in classJasperPrint
- Returns:
- this object's properties map
-
getParentProperties
public JRPropertiesHolder getParentProperties()
Description copied from interface:JRPropertiesHolder
Returns the parent properties holder, whose properties are used as defaults for this object.- Specified by:
getParentProperties
in interfaceJRPropertiesHolder
- Overrides:
getParentProperties
in classJasperPrint
- Returns:
- the parent properties holder, or
null
if no parent
-
getPropertyNames
public String[] getPropertyNames()
- Overrides:
getPropertyNames
in classJasperPrint
-
getProperty
public String getProperty(String propName)
- Overrides:
getProperty
in classJasperPrint
-
setProperty
public void setProperty(String propName, String value)
- Overrides:
setProperty
in classJasperPrint
-
removeProperty
public void removeProperty(String propName)
- Overrides:
removeProperty
in classJasperPrint
-
getDefaultStyle
public JRStyle getDefaultStyle()
Description copied from class:JasperPrint
Returns the default report style.- Overrides:
getDefaultStyle
in classJasperPrint
-
setDefaultStyle
public void setDefaultStyle(JRStyle style)
Description copied from class:JasperPrint
Sets the default report style.- Overrides:
setDefaultStyle
in classJasperPrint
-
getDefaultStyleProvider
public JRDefaultStyleProvider getDefaultStyleProvider()
Description copied from class:JasperPrint
When we want to virtualize pages, we want a style provider that is not the print object itself.- Overrides:
getDefaultStyleProvider
in classJasperPrint
-
getStyles
public JRStyle[] getStyles()
Description copied from class:JasperPrint
Gets an array of report styles.- Overrides:
getStyles
in classJasperPrint
-
getStylesList
public List<JRStyle> getStylesList()
Description copied from class:JasperPrint
Gets a list of report styles.- Overrides:
getStylesList
in classJasperPrint
-
getStylesMap
public Map<String,JRStyle> getStylesMap()
Description copied from class:JasperPrint
Gets a map of report styles.- Overrides:
getStylesMap
in classJasperPrint
-
addStyle
public void addStyle(JRStyle style) throws JRException
Description copied from class:JasperPrint
Adds a new style to the report styles.- Overrides:
addStyle
in classJasperPrint
- Throws:
JRException
-
addStyle
public void addStyle(JRStyle style, boolean isIgnoreDuplicate) throws JRException
Description copied from class:JasperPrint
Adds a new style to the report styles.- Overrides:
addStyle
in classJasperPrint
- Throws:
JRException
-
removeStyle
public JRStyle removeStyle(String styleName)
- Overrides:
removeStyle
in classJasperPrint
-
removeStyle
public JRStyle removeStyle(JRStyle style)
- Overrides:
removeStyle
in classJasperPrint
-
getOrigins
public JROrigin[] getOrigins()
Description copied from class:JasperPrint
Gets an array of report origins.- Overrides:
getOrigins
in classJasperPrint
-
getOriginsList
public List<JROrigin> getOriginsList()
Description copied from class:JasperPrint
Gets a list of report origins.- Overrides:
getOriginsList
in classJasperPrint
-
getOriginsMap
public Map<JROrigin,Integer> getOriginsMap()
Description copied from class:JasperPrint
Gets a map of report origins.- Overrides:
getOriginsMap
in classJasperPrint
-
addOrigin
public void addOrigin(JROrigin origin)
Description copied from class:JasperPrint
Adds a new style to the report origins.- Overrides:
addOrigin
in classJasperPrint
-
removeOrigin
public JROrigin removeOrigin(JROrigin origin)
- Overrides:
removeOrigin
in classJasperPrint
-
getParts
public PrintParts getParts()
Description copied from class:JasperPrint
Returns a list of all parts in the filled report.- Overrides:
getParts
in classJasperPrint
-
addPart
public void addPart(int pageIndex, PrintPart part)
Description copied from class:JasperPrint
Adds a new part to the document.- Overrides:
addPart
in classJasperPrint
-
removePart
public PrintPart removePart(int pageIndex)
Description copied from class:JasperPrint
Removes a part from the document.- Overrides:
removePart
in classJasperPrint
-
getPages
public List<JRPrintPage> getPages()
Description copied from class:JasperPrint
Returns a list of all pages in the filled report.- Overrides:
getPages
in classJasperPrint
-
addPage
public void addPage(JRPrintPage page)
Description copied from class:JasperPrint
Adds a new page to the document.- Overrides:
addPage
in classJasperPrint
-
addPage
public void addPage(int index, JRPrintPage page)
Description copied from class:JasperPrint
Adds a new page to the document, placing it at the specified index.- Overrides:
addPage
in classJasperPrint
-
removePage
public JRPrintPage removePage(int index)
Description copied from class:JasperPrint
Removes a page from the document.- Overrides:
removePage
in classJasperPrint
-
getBookmarks
public List<PrintBookmark> getBookmarks()
- Overrides:
getBookmarks
in classJasperPrint
-
addBookmark
public void addBookmark(PrintBookmark bookmark)
Description copied from class:JasperPrint
Adds a new page to the document.- Overrides:
addBookmark
in classJasperPrint
-
setBookmarks
public void setBookmarks(List<PrintBookmark> bookmarks)
- Overrides:
setBookmarks
in classJasperPrint
-
getAnchorIndexes
public Map<String,JRPrintAnchorIndex> getAnchorIndexes()
- Overrides:
getAnchorIndexes
in classJasperPrint
-
getFormatFactoryClass
public String getFormatFactoryClass()
Description copied from class:JasperPrint
Returns the name of the class implementing theFormatFactory
interface to use with this document.- Overrides:
getFormatFactoryClass
in classJasperPrint
-
setFormatFactoryClass
public void setFormatFactoryClass(String formatFactoryClass)
Description copied from class:JasperPrint
Sets the name of the class implementing theFormatFactory
interface to use with this document.- Overrides:
setFormatFactoryClass
in classJasperPrint
-
getLocaleCode
public String getLocaleCode()
Description copied from class:JasperPrint
Returns the code of the defaultjava.util.Locale
to be used for the elements of this print object.When filling a report, the value of the
REPORT_LOCALE
parameter (or the default locale if the parameter has no explicit value) is saved using this attribute. Some elements (e.g. elements rendered by a subreport) in the print object can override this default locale.- Overrides:
getLocaleCode
in classJasperPrint
- Returns:
- the code of the default
java.util.Locale
for this object - See Also:
JRPrintText.getLocaleCode()
-
setLocaleCode
public void setLocaleCode(String localeCode)
Description copied from class:JasperPrint
Sets the the code of the defaultjava.util.Locale
to be used for this object.- Overrides:
setLocaleCode
in classJasperPrint
- Parameters:
localeCode
- the locale code, using thejava.util.Locale.toString()
convention.- See Also:
JasperPrint.getLocaleCode()
,Locale.toString()
-
getTimeZoneId
public String getTimeZoneId()
Description copied from class:JasperPrint
Returns theID
of the defaultjava.util.TimeZone
to be used for the elements of this print object.When filling a report, the value of the
REPORT_TIME_ZONE
parameter (or the default time zine if the parameter has no explicit value) is saved using this attribute. Some elements (e.g. elements rendered by a subreport) in the print object can override this default time zone.- Overrides:
getTimeZoneId
in classJasperPrint
- Returns:
- the ID of the default
java.util.TimeZone
for this object - See Also:
JRPrintText.getTimeZoneId()
-
setTimeZoneId
public void setTimeZoneId(String timeZoneId)
Description copied from class:JasperPrint
Sets the theID
of the defaultjava.util.TimeZone
to be used for this object.- Overrides:
setTimeZoneId
in classJasperPrint
- Parameters:
timeZoneId
- the time zone ID- See Also:
JasperPrint.getTimeZoneId()
,TimeZone.getID()
-
-