|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object net.sf.jasperreports.engine.JasperPrint
public class JasperPrint
An instance of this class represents a page-oriented document that can be viewed, printed or exported to other formats.
When filling report designs with data, the engine produces instances of this class and these can be transferred over the network, stored in a serialized form on disk or exported to various other formats like PDF, HTML, XLS, CSV or XML.
Field Summary | |
---|---|
static java.lang.String |
PROPERTIES_PRINT_TRANSFER_PREFIX
Prefix for JasperReports properties that specify properties to be transfered from report templates to print objects. |
Constructor Summary | |
---|---|
JasperPrint()
Creates a new empty document. |
Method Summary | |
---|---|
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 |
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. |
protected void |
collectAnchors(java.util.Collection<JRPrintElement> elements,
int pageIndex,
int offsetX,
int offsetY)
|
java.util.Map<java.lang.String,JRPrintAnchorIndex> |
getAnchorIndexes()
|
java.lang.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. |
java.lang.String |
getFormatFactoryClass()
Returns the name of the class implementing the FormatFactory
interface to use with this document. |
java.lang.Integer |
getLeftMargin()
|
java.lang.String |
getLocaleCode()
Returns the code of the default java.util.Locale to be used for the
elements of this print object. |
java.lang.String |
getName()
|
OrientationEnum |
getOrientationValue()
Returns the page orientation. |
JROrigin[] |
getOrigins()
Gets an array of report origins. |
java.util.List<JROrigin> |
getOriginsList()
Gets a list of report origins. |
java.util.Map<JROrigin,java.lang.Integer> |
getOriginsMap()
Gets a map of report origins. |
int |
getPageHeight()
|
java.util.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. |
JRPropertiesMap |
getPropertiesMap()
Returns this object's properties map. |
java.lang.String |
getProperty(java.lang.String propName)
|
java.lang.String[] |
getPropertyNames()
|
java.lang.Integer |
getRightMargin()
|
JRStyle[] |
getStyles()
Gets an array of report styles. |
java.util.List<JRStyle> |
getStylesList()
Gets a list of report styles. |
java.util.Map<java.lang.String,JRStyle> |
getStylesMap()
Gets a map of report styles. |
java.lang.String |
getTimeZoneId()
Returns the ID of the default java.util.TimeZone
to be used for the elements of this print object. |
java.lang.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. |
void |
removeProperty(java.lang.String propName)
|
JRStyle |
removeStyle(JRStyle style)
|
JRStyle |
removeStyle(java.lang.String styleName)
|
void |
setBottomMargin(java.lang.Integer bottomMargin)
Sets the bottom page margin. |
void |
setDefaultStyle(JRStyle style)
Sets the default report style. |
void |
setFormatFactoryClass(java.lang.String formatFactoryClass)
Sets the name of the class implementing the FormatFactory
interface to use with this document. |
void |
setLeftMargin(java.lang.Integer leftMargin)
Sets the left page margin. |
void |
setLocaleCode(java.lang.String localeCode)
Sets the the code of the default java.util.Locale to be used for this object. |
void |
setName(java.lang.String name)
Sets the name of the document. |
void |
setOrientation(OrientationEnum orientationValue)
Sets the page orientation. |
void |
setPageHeight(int pageHeight)
Sets the page height. |
void |
setPageWidth(int pageWidth)
Sets the page width. |
void |
setProperty(java.lang.String propName,
java.lang.String value)
|
void |
setRightMargin(java.lang.Integer rightMargin)
Sets the right page margin. |
void |
setTimeZoneId(java.lang.String timeZoneId)
Sets the the ID of the default java.util.TimeZone
to be used for this object. |
void |
setTopMargin(java.lang.Integer topMargin)
Sets the top page margin. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final java.lang.String PROPERTIES_PRINT_TRANSFER_PREFIX
JRPropertiesUtil.transferProperties(JRPropertiesHolder, JRPropertiesHolder, String)
,
Constant Field ValuesConstructor Detail |
---|
public JasperPrint()
Method Detail |
---|
public java.lang.String getName()
public void setName(java.lang.String name)
name
- name of the documentpublic int getPageWidth()
public void setPageWidth(int pageWidth)
pageWidth
- page widthpublic int getPageHeight()
public void setPageHeight(int pageHeight)
pageHeight
- page heightpublic java.lang.Integer getTopMargin()
public void setTopMargin(java.lang.Integer topMargin)
topMargin
- top page marginpublic java.lang.Integer getLeftMargin()
public void setLeftMargin(java.lang.Integer leftMargin)
leftMargin
- left page marginpublic java.lang.Integer getBottomMargin()
public void setBottomMargin(java.lang.Integer bottomMargin)
bottomMargin
- bottom page marginpublic java.lang.Integer getRightMargin()
public void setRightMargin(java.lang.Integer rightMargin)
rightMargin
- right page marginpublic OrientationEnum getOrientationValue()
PORTRAIT,
,
LANDSCAPE
public void setOrientation(OrientationEnum orientationValue)
PORTRAIT,
,
LANDSCAPE
public boolean hasProperties()
JRPropertiesHolder
hasProperties
in interface JRPropertiesHolder
public JRPropertiesMap getPropertiesMap()
JRPropertiesHolder
getPropertiesMap
in interface JRPropertiesHolder
public JRPropertiesHolder getParentProperties()
JRPropertiesHolder
getParentProperties
in interface JRPropertiesHolder
null
if no parentpublic java.lang.String[] getPropertyNames()
public java.lang.String getProperty(java.lang.String propName)
public void setProperty(java.lang.String propName, java.lang.String value)
public void removeProperty(java.lang.String propName)
public JRStyle getDefaultStyle()
public void setDefaultStyle(JRStyle style)
public JRDefaultStyleProvider getDefaultStyleProvider()
public JRStyle[] getStyles()
public java.util.List<JRStyle> getStylesList()
public java.util.Map<java.lang.String,JRStyle> getStylesMap()
public void addStyle(JRStyle style) throws JRException
JRException
public void addStyle(JRStyle style, boolean isIgnoreDuplicate) throws JRException
JRException
public JRStyle removeStyle(java.lang.String styleName)
public JRStyle removeStyle(JRStyle style)
public JROrigin[] getOrigins()
public java.util.List<JROrigin> getOriginsList()
public java.util.Map<JROrigin,java.lang.Integer> getOriginsMap()
public void addOrigin(JROrigin origin)
public JROrigin removeOrigin(JROrigin origin)
public java.util.List<JRPrintPage> getPages()
public void addPage(JRPrintPage page)
public void addPage(int index, JRPrintPage page)
public JRPrintPage removePage(int index)
public java.util.Map<java.lang.String,JRPrintAnchorIndex> getAnchorIndexes()
protected void collectAnchors(java.util.Collection<JRPrintElement> elements, int pageIndex, int offsetX, int offsetY)
public java.lang.String getFormatFactoryClass()
FormatFactory
interface to use with this document.
public void setFormatFactoryClass(java.lang.String formatFactoryClass)
FormatFactory
interface to use with this document.
public java.lang.String getLocaleCode()
java.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.
java.util.Locale
for this objectJRPrintText.getLocaleCode()
public void setLocaleCode(java.lang.String localeCode)
java.util.Locale
to be used for this object.
localeCode
- the locale code, using the java.util.Locale.toString()
convention.getLocaleCode()
,
Locale.toString()
public java.lang.String getTimeZoneId()
ID
of the default java.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.
java.util.TimeZone
for this objectJRPrintText.getTimeZoneId()
public void setTimeZoneId(java.lang.String timeZoneId)
ID
of the default java.util.TimeZone
to be used for this object.
timeZoneId
- the time zone IDgetTimeZoneId()
,
TimeZone.getID()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |