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 voidaddBookmark(PrintBookmark bookmark)Adds a new page to the document.voidaddOrigin(JROrigin origin)Adds a new style to the report origins.voidaddPage(int index, JRPrintPage page)Adds a new page to the document, placing it at the specified index.voidaddPage(JRPrintPage page)Adds a new page to the document.voidaddPart(int pageIndex, PrintPart part)Adds a new part to the document.voidaddStyle(JRStyle style)Adds a new style to the report styles.voidaddStyle(JRStyle style, boolean isIgnoreDuplicate)Adds a new style to the report styles.Map<String,JRPrintAnchorIndex>getAnchorIndexes()List<PrintBookmark>getBookmarks()IntegergetBottomMargin()JRStylegetDefaultStyle()Returns the default report style.JRDefaultStyleProvidergetDefaultStyleProvider()When we want to virtualize pages, we want a style provider that is not the print object itself.StringgetFormatFactoryClass()Returns the name of the class implementing theFormatFactoryinterface to use with this document.IntegergetLeftMargin()StringgetLocaleCode()Returns the code of the defaultjava.util.Localeto be used for the elements of this print object.StringgetName()OrientationEnumgetOrientationValue()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.intgetPageHeight()List<JRPrintPage>getPages()Returns a list of all pages in the filled report.intgetPageWidth()JRPropertiesHoldergetParentProperties()Returns the parent properties holder, whose properties are used as defaults for this object.PrintPartsgetParts()Returns a list of all parts in the filled report.JRPropertiesMapgetPropertiesMap()Returns this object's properties map.StringgetProperty(String propName)String[]getPropertyNames()IntegergetRightMargin()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.StringgetTimeZoneId()Returns theIDof the defaultjava.util.TimeZoneto be used for the elements of this print object.IntegergetTopMargin()booleanhasProperties()Checks whether the object has any properties.JROriginremoveOrigin(JROrigin origin)JRPrintPageremovePage(int index)Removes a page from the document.PrintPartremovePart(int pageIndex)Removes a part from the document.voidremoveProperty(String propName)JRStyleremoveStyle(String styleName)JRStyleremoveStyle(JRStyle style)voidsetBookmarks(List<PrintBookmark> bookmarks)voidsetBottomMargin(Integer bottomMargin)Sets the bottom page margin.voidsetDefaultStyle(JRStyle style)Sets the default report style.voidsetFormatFactoryClass(String formatFactoryClass)Sets the name of the class implementing theFormatFactoryinterface to use with this document.voidsetLeftMargin(Integer leftMargin)Sets the left page margin.voidsetLocaleCode(String localeCode)Sets the the code of the defaultjava.util.Localeto be used for this object.voidsetName(String name)Sets the name of the document.voidsetOrientation(OrientationEnum orientationValue)Sets the page orientation.voidsetPageHeight(int pageHeight)Sets the page height.voidsetPageWidth(int pageWidth)Sets the page width.voidsetProperty(String propName, String value)voidsetRightMargin(Integer rightMargin)Sets the right page margin.voidsetTimeZoneId(String timeZoneId)Sets the theIDof the defaultjava.util.TimeZoneto be used for this object.voidsetTopMargin(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:
getNamein classJasperPrint- Returns:
- Returns the name of the document
-
setName
public void setName(String name)
Description copied from class:JasperPrintSets the name of the document.- Overrides:
setNamein classJasperPrint- Parameters:
name- name of the document
-
getPageWidth
public int getPageWidth()
- Overrides:
getPageWidthin classJasperPrint- Returns:
- Returns the page width
-
setPageWidth
public void setPageWidth(int pageWidth)
Description copied from class:JasperPrintSets the page width.- Overrides:
setPageWidthin classJasperPrint- Parameters:
pageWidth- page width
-
getPageHeight
public int getPageHeight()
- Overrides:
getPageHeightin classJasperPrint- Returns:
- Returns the page height.
-
setPageHeight
public void setPageHeight(int pageHeight)
Description copied from class:JasperPrintSets the page height.- Overrides:
setPageHeightin classJasperPrint- Parameters:
pageHeight- page height
-
getTopMargin
public Integer getTopMargin()
- Overrides:
getTopMarginin classJasperPrint- Returns:
- Returns the top page margin
-
setTopMargin
public void setTopMargin(Integer topMargin)
Description copied from class:JasperPrintSets the top page margin.- Overrides:
setTopMarginin classJasperPrint- Parameters:
topMargin- top page margin
-
getLeftMargin
public Integer getLeftMargin()
- Overrides:
getLeftMarginin classJasperPrint- Returns:
- Returns the left page margin
-
setLeftMargin
public void setLeftMargin(Integer leftMargin)
Description copied from class:JasperPrintSets the left page margin.- Overrides:
setLeftMarginin classJasperPrint- Parameters:
leftMargin- left page margin
-
getBottomMargin
public Integer getBottomMargin()
- Overrides:
getBottomMarginin classJasperPrint- Returns:
- Returns the bottom page margin
-
setBottomMargin
public void setBottomMargin(Integer bottomMargin)
Description copied from class:JasperPrintSets the bottom page margin.- Overrides:
setBottomMarginin classJasperPrint- Parameters:
bottomMargin- bottom page margin
-
getRightMargin
public Integer getRightMargin()
- Overrides:
getRightMarginin classJasperPrint- Returns:
- Returns the right page margin
-
setRightMargin
public void setRightMargin(Integer rightMargin)
Description copied from class:JasperPrintSets the right page margin.- Overrides:
setRightMarginin classJasperPrint- Parameters:
rightMargin- right page margin
-
getOrientationValue
public OrientationEnum getOrientationValue()
Description copied from class:JasperPrintReturns the page orientation.- Overrides:
getOrientationValuein classJasperPrint- See Also:
PORTRAIT,,LANDSCAPE
-
setOrientation
public void setOrientation(OrientationEnum orientationValue)
Description copied from class:JasperPrintSets the page orientation.- Overrides:
setOrientationin classJasperPrint- See Also:
PORTRAIT,,LANDSCAPE
-
hasProperties
public boolean hasProperties()
Description copied from interface:JRPropertiesHolderChecks whether the object has any properties.- Specified by:
hasPropertiesin interfaceJRPropertiesHolder- Overrides:
hasPropertiesin classJasperPrint- Returns:
- whether the object has any properties
-
getPropertiesMap
public JRPropertiesMap getPropertiesMap()
Description copied from interface:JRPropertiesHolderReturns this object's properties map.- Specified by:
getPropertiesMapin interfaceJRPropertiesHolder- Overrides:
getPropertiesMapin classJasperPrint- Returns:
- this object's properties map
-
getParentProperties
public JRPropertiesHolder getParentProperties()
Description copied from interface:JRPropertiesHolderReturns the parent properties holder, whose properties are used as defaults for this object.- Specified by:
getParentPropertiesin interfaceJRPropertiesHolder- Overrides:
getParentPropertiesin classJasperPrint- Returns:
- the parent properties holder, or
nullif no parent
-
getPropertyNames
public String[] getPropertyNames()
- Overrides:
getPropertyNamesin classJasperPrint
-
getProperty
public String getProperty(String propName)
- Overrides:
getPropertyin classJasperPrint
-
setProperty
public void setProperty(String propName, String value)
- Overrides:
setPropertyin classJasperPrint
-
removeProperty
public void removeProperty(String propName)
- Overrides:
removePropertyin classJasperPrint
-
getDefaultStyle
public JRStyle getDefaultStyle()
Description copied from class:JasperPrintReturns the default report style.- Overrides:
getDefaultStylein classJasperPrint
-
setDefaultStyle
public void setDefaultStyle(JRStyle style)
Description copied from class:JasperPrintSets the default report style.- Overrides:
setDefaultStylein classJasperPrint
-
getDefaultStyleProvider
public JRDefaultStyleProvider getDefaultStyleProvider()
Description copied from class:JasperPrintWhen we want to virtualize pages, we want a style provider that is not the print object itself.- Overrides:
getDefaultStyleProviderin classJasperPrint
-
getStyles
public JRStyle[] getStyles()
Description copied from class:JasperPrintGets an array of report styles.- Overrides:
getStylesin classJasperPrint
-
getStylesList
public List<JRStyle> getStylesList()
Description copied from class:JasperPrintGets a list of report styles.- Overrides:
getStylesListin classJasperPrint
-
getStylesMap
public Map<String,JRStyle> getStylesMap()
Description copied from class:JasperPrintGets a map of report styles.- Overrides:
getStylesMapin classJasperPrint
-
addStyle
public void addStyle(JRStyle style) throws JRException
Description copied from class:JasperPrintAdds a new style to the report styles.- Overrides:
addStylein classJasperPrint- Throws:
JRException
-
addStyle
public void addStyle(JRStyle style, boolean isIgnoreDuplicate) throws JRException
Description copied from class:JasperPrintAdds a new style to the report styles.- Overrides:
addStylein classJasperPrint- Throws:
JRException
-
removeStyle
public JRStyle removeStyle(String styleName)
- Overrides:
removeStylein classJasperPrint
-
removeStyle
public JRStyle removeStyle(JRStyle style)
- Overrides:
removeStylein classJasperPrint
-
getOrigins
public JROrigin[] getOrigins()
Description copied from class:JasperPrintGets an array of report origins.- Overrides:
getOriginsin classJasperPrint
-
getOriginsList
public List<JROrigin> getOriginsList()
Description copied from class:JasperPrintGets a list of report origins.- Overrides:
getOriginsListin classJasperPrint
-
getOriginsMap
public Map<JROrigin,Integer> getOriginsMap()
Description copied from class:JasperPrintGets a map of report origins.- Overrides:
getOriginsMapin classJasperPrint
-
addOrigin
public void addOrigin(JROrigin origin)
Description copied from class:JasperPrintAdds a new style to the report origins.- Overrides:
addOriginin classJasperPrint
-
removeOrigin
public JROrigin removeOrigin(JROrigin origin)
- Overrides:
removeOriginin classJasperPrint
-
getParts
public PrintParts getParts()
Description copied from class:JasperPrintReturns a list of all parts in the filled report.- Overrides:
getPartsin classJasperPrint
-
addPart
public void addPart(int pageIndex, PrintPart part)Description copied from class:JasperPrintAdds a new part to the document.- Overrides:
addPartin classJasperPrint
-
removePart
public PrintPart removePart(int pageIndex)
Description copied from class:JasperPrintRemoves a part from the document.- Overrides:
removePartin classJasperPrint
-
getPages
public List<JRPrintPage> getPages()
Description copied from class:JasperPrintReturns a list of all pages in the filled report.- Overrides:
getPagesin classJasperPrint
-
addPage
public void addPage(JRPrintPage page)
Description copied from class:JasperPrintAdds a new page to the document.- Overrides:
addPagein classJasperPrint
-
addPage
public void addPage(int index, JRPrintPage page)Description copied from class:JasperPrintAdds a new page to the document, placing it at the specified index.- Overrides:
addPagein classJasperPrint
-
removePage
public JRPrintPage removePage(int index)
Description copied from class:JasperPrintRemoves a page from the document.- Overrides:
removePagein classJasperPrint
-
getBookmarks
public List<PrintBookmark> getBookmarks()
- Overrides:
getBookmarksin classJasperPrint
-
addBookmark
public void addBookmark(PrintBookmark bookmark)
Description copied from class:JasperPrintAdds a new page to the document.- Overrides:
addBookmarkin classJasperPrint
-
setBookmarks
public void setBookmarks(List<PrintBookmark> bookmarks)
- Overrides:
setBookmarksin classJasperPrint
-
getAnchorIndexes
public Map<String,JRPrintAnchorIndex> getAnchorIndexes()
- Overrides:
getAnchorIndexesin classJasperPrint
-
getFormatFactoryClass
public String getFormatFactoryClass()
Description copied from class:JasperPrintReturns the name of the class implementing theFormatFactoryinterface to use with this document.- Overrides:
getFormatFactoryClassin classJasperPrint
-
setFormatFactoryClass
public void setFormatFactoryClass(String formatFactoryClass)
Description copied from class:JasperPrintSets the name of the class implementing theFormatFactoryinterface to use with this document.- Overrides:
setFormatFactoryClassin classJasperPrint
-
getLocaleCode
public String getLocaleCode()
Description copied from class:JasperPrintReturns the code of the defaultjava.util.Localeto be used for the elements of this print object.When filling a report, the value of the
REPORT_LOCALEparameter (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:
getLocaleCodein classJasperPrint- Returns:
- the code of the default
java.util.Localefor this object - See Also:
JRPrintText.getLocaleCode()
-
setLocaleCode
public void setLocaleCode(String localeCode)
Description copied from class:JasperPrintSets the the code of the defaultjava.util.Localeto be used for this object.- Overrides:
setLocaleCodein 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:JasperPrintReturns theIDof the defaultjava.util.TimeZoneto be used for the elements of this print object.When filling a report, the value of the
REPORT_TIME_ZONEparameter (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:
getTimeZoneIdin classJasperPrint- Returns:
- the ID of the default
java.util.TimeZonefor this object - See Also:
JRPrintText.getTimeZoneId()
-
setTimeZoneId
public void setTimeZoneId(String timeZoneId)
Description copied from class:JasperPrintSets the theIDof the defaultjava.util.TimeZoneto be used for this object.- Overrides:
setTimeZoneIdin classJasperPrint- Parameters:
timeZoneId- the time zone ID- See Also:
JasperPrint.getTimeZoneId(),TimeZone.getID()
-
-