Package org.idempiere.print.renderer
Class HTMLReportRenderer
java.lang.Object
org.idempiere.print.renderer.HTMLReportRenderer
- All Implemented Interfaces:
IReportRenderer<HTMLReportRendererConfiguration>
public class HTMLReportRenderer
extends Object
implements IReportRenderer<HTMLReportRendererConfiguration>
HTML content renderer service for report engine
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic class
Store info of report column,
now just use index to create css selector, but for later maybe will construct a complex class namestatic class
Store info for css rule -
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic void
addCssInfo
(MPrintFormat printFormat, MPrintFormatItem formatItem, int index, Map<HTMLReportRenderer.CSSInfo, List<HTMLReportRenderer.ColumnInfo>> mapCssInfo) Create css info from formatItem, add all column has same CSSInfo in a liststatic void
appendInlineCss
(org.apache.ecs.XhtmlDocument doc, StringBuilder buildCssInline) Append inline css contentstatic void
appendInlineCss
(org.apache.ecs.XhtmlDocument doc, Map<HTMLReportRenderer.CSSInfo, List<HTMLReportRenderer.ColumnInfo>> mapCssInfo) Append css for table from mapCssInfostatic String
Compress html contentstatic String
createDataURLImage
(byte[] imageData) Get configuration typeGet MIME content type (text/html, etc)Get file extension (without dot)getId()
Get id of renderergetName()
Get renderer nameboolean
isBinary()
Is binary contentvoid
renderReport
(ReportEngine reportEngine, HTMLReportRendererConfiguration configuration) Render content for report enginestatic void
Set inline style of element
-
Constructor Details
-
HTMLReportRenderer
public HTMLReportRenderer()
-
-
Method Details
-
getId
Description copied from interface:IReportRenderer
Get id of renderer- Specified by:
getId
in interfaceIReportRenderer<HTMLReportRendererConfiguration>
- Returns:
- renderer id (HTML, XLS, etc)
-
getName
Description copied from interface:IReportRenderer
Get renderer name- Specified by:
getName
in interfaceIReportRenderer<HTMLReportRendererConfiguration>
- Returns:
- renderer name
-
getContentType
Description copied from interface:IReportRenderer
Get MIME content type (text/html, etc)- Specified by:
getContentType
in interfaceIReportRenderer<HTMLReportRendererConfiguration>
- Returns:
- MIME content type
-
getFileExtension
Description copied from interface:IReportRenderer
Get file extension (without dot)- Specified by:
getFileExtension
in interfaceIReportRenderer<HTMLReportRendererConfiguration>
- Returns:
- file extension
-
renderReport
Description copied from interface:IReportRenderer
Render content for report engine- Specified by:
renderReport
in interfaceIReportRenderer<HTMLReportRendererConfiguration>
-
isBinary
public boolean isBinary()Description copied from interface:IReportRenderer
Is binary content- Specified by:
isBinary
in interfaceIReportRenderer<HTMLReportRendererConfiguration>
- Returns:
- true if content is binary
-
createDataURLImage
-
compress
Compress html content- Parameters:
src
-minify
-- Returns:
- compressed content
-
appendInlineCss
public static void appendInlineCss(org.apache.ecs.XhtmlDocument doc, Map<HTMLReportRenderer.CSSInfo, List<HTMLReportRenderer.ColumnInfo>> mapCssInfo) Append css for table from mapCssInfo- Parameters:
doc
-
-
appendInlineCss
Append inline css content- Parameters:
doc
-buildCssInline
-
-
addCssInfo
public static void addCssInfo(MPrintFormat printFormat, MPrintFormatItem formatItem, int index, Map<HTMLReportRenderer.CSSInfo, List<HTMLReportRenderer.ColumnInfo>> mapCssInfo) Create css info from formatItem, add all column has same CSSInfo in a list- Parameters:
formatItem
-index
-
-
setStyle
public static void setStyle(PrintData printData, org.apache.ecs.MultiPartElement element, MStyle style) Set inline style of element- Parameters:
printData
-element
-style
-
-
getConfigurationType
Description copied from interface:IReportRenderer
Get configuration type- Specified by:
getConfigurationType
in interfaceIReportRenderer<HTMLReportRendererConfiguration>
- Returns:
- configuration type
-