Package com.nomagic.magicreport.format
Class XLSXFormatter
java.lang.Object
com.nomagic.magicreport.format.DefaultFormatter
com.nomagic.magicreport.format.XLSXFormatter
- All Implemented Interfaces:
IFormatter
The Velocity engine support for XLSX.
- Since:
- Dec 9, 2009
-
Field Summary
Fields inherited from class com.nomagic.magicreport.format.DefaultFormatter
properties, styledDocumentFields inherited from interface com.nomagic.magicreport.format.IFormatter
DOT_PER_INCH -
Constructor Summary
ConstructorsConstructorDescriptionXLSXFormatter(ITemplateEngine templateEngine) Create a XLSX formatter with specific properties.XLSXFormatter(Properties properties) Create a XLSX formatter with specific properties. -
Method Summary
Modifier and TypeMethodDescriptionprotected float[]adjustImage(float w, float h, int flag) protected float[]adjustImage(Image image, float w, float h, int flag) Returns [imageWidth, imageHeight, imageRotate] the image will be rotated if necessary 914,400 EMU per inch 12,700 EMU in a point360,000 EMU per cm.protected ITool.RetainedStringcreateBookmark(Bookmark bookmark) Create a XLSX bookmark string from givenBookmarkobject.protected ITool.RetainedStringcreateChart(XLSXChart chart) Create a XLSX chart string from givenXLSXChartobject.protected StringcreateColumn(Column column) Increase new columns from givenColumnobject.protected StringcreateGridRowSpan(GridRowSpan span) Create a XLSX gridrowspan (merge columns vertically) string from givenGridRowSpanobject.protected StringcreateGridSpan(GridSpan span) Create a XLSX gridspan (merge columns horizontally) string from givenGridSpanobject.protected ITool.RetainedStringcreateImage(Image image) Create a DOCX image string from givenImageobject.protected ITool.RetainedStringcreateImage(Image image, float width, float height, int flag) Create a DOCX image string from givenImageobject.protected ITool.RetainedStringcreateLink(Link link) Create a XLSX link string from givenLinkobject.Convert an Object value into HTML format.float[]Get pageSize in Inches.Methods inherited from class com.nomagic.magicreport.format.DefaultFormatter
getImageFlag, getObjectFormater, getProperties, registerObjectFormatter, setProperties, setStyledDocument, writeImage, writeImage, writeImage
-
Constructor Details
-
XLSXFormatter
Create a XLSX formatter with specific properties.- Parameters:
templateEngine- template engine
-
XLSXFormatter
Create a XLSX formatter with specific properties.- Parameters:
properties- template properties
-
-
Method Details
-
format
Convert an Object value into HTML format.- Specified by:
formatin interfaceIFormatter- Overrides:
formatin classDefaultFormatter- Parameters:
value- converting value- Returns:
- object in default format.
-
createChart
Create a XLSX chart string from givenXLSXChartobject.- Parameters:
chart- anXLSXChartobject- Returns:
- The String in XLSX chart format.
- Throws:
IOException- when IO error occurs
-
createImage
Create a DOCX image string from givenImageobject.- Parameters:
image- anImageobject- Returns:
- The String in DOCX image format.
- Throws:
IOException- when IO error occurs
-
createImage
protected ITool.RetainedString createImage(Image image, float width, float height, int flag) throws IOException Create a DOCX image string from givenImageobject.- Parameters:
image- anImageobjectwidth- the target image widthheight- the target image heightflag- scaling image flag- Returns:
- The String in DOCX image format.
- Throws:
IOException- when IO error occurs
-
getPageSize
public float[] getPageSize()Get pageSize in Inches.- Returns:
- pageWidth and pageHeight
-
adjustImage
protected float[] adjustImage(float w, float h, int flag) -
adjustImage
Returns [imageWidth, imageHeight, imageRotate] the image will be rotated if necessary 914,400 EMU per inch 12,700 EMU in a point360,000 EMU per cm.- Parameters:
w- image widthh- image heightflag- scaling image flag- Returns:
- the new dimension of image
-
createBookmark
Create a XLSX bookmark string from givenBookmarkobject.- Parameters:
bookmark- anBookmarkobject- Returns:
- The String in XLSX bookmark format.
- Throws:
IOException- when IO error occurs
-
createLink
Create a XLSX link string from givenLinkobject.- Parameters:
link- anLinkobject- Returns:
- The String in XLSX link format.
- Throws:
IOException- when IO error occurs
-
createGridSpan
Create a XLSX gridspan (merge columns horizontally) string from givenGridSpanobject.- Parameters:
span- anGridSpanobject- Returns:
- The String in PPT for gridspan format.
-
createColumn
Increase new columns from givenColumnobject.- Parameters:
column- anColumnobject- Returns:
- The String of new columns
-
createGridRowSpan
Create a XLSX gridrowspan (merge columns vertically) string from givenGridRowSpanobject.- Parameters:
span- anGridRowSpanobject- Returns:
- The String in XLSX for gridrowspan format.
-