在此文中
The class Banana.Report.ReportStyle represents a single style in a stylesheet. It is used to set the style attributes.
Methods
setAttribute(attr_name, attr_value)
Set the attribute value. Attributes' ids and values follow the CSS specification.
style.setAttribute("font-size", "24pt");
setAttributes(attributes)
Set attributes values. Attributes' ids and values follow the CSS specification.
style.setAttributes("font-size:24pt;font-weight:bold;");
Supported properties
font
font-family
font-size
font-style
font-weight
margin [top, right, bottom, left]
margin-top
margin-bottom
margin-left
margin-right
padding
padding-top
padding-bottom
padding-left
padding-right
hanging-ident
text-align
text-decoration
text-ellipsis
vertical-align
color
background-color
border
border-top
border-top-style
border-top-color
border-top-width
border-bottom
border-bottom-style
border-bottom-color
border-bottom-width
border-left
border-left-style
border-left-color
border-left-width
border-right
border-right-style
border-right-color
border-right-width
display
overflow
float
text-wrap
width
max-width
min-width
height
page-break-after
column-break-after
line-break-after
page-break-before
column-break-before
line-break-before
page-break-inside
line-break-inside
size
position
left
top
right
bottom
transform
Supported transformations are: matrix, translateX, translateY, translate, rotate, scaleX, scaleY, scale, skewX, skewY and skew
transformOrigin
orphans
fill-empty-area
Non standard attributes and values
width-sym
This attribute contains a string. Columns with the same width-sym will be laid out with the same width.
layout-sym
This attribute is a string. Tables with the same layout-sym attribute will have the same layout for the width of the columns.
overflow
This attribute has the non standard value "shrink". The content of the node will be down scaled to fit given space.
style.setAttribute("overflow", "shrink");
overflow-shrink-max
This attibute set the maximal down scaling factor (like 0.6).
style.setAttribute("overflow-shrink-max", "0.6");
text-decoration
This attribute can also contain the values "double-underline" or "double-strong-underline".
style.setAttribute("text-decoration", "underline");
border-style
This attribute can also contain the values "double" and "double-strong".
style.setAttribute("border-style", "double");
flexible-width
This attribute can contain the value "always" and is only used with columns. If, in a table, one or more columns have the attribute "flexible-widht", only those columns are enlarged to get the desired table width, untouching the others. Otherwise all columns are enlarged.
fill-empty-area
With this attribute you can fill the remaing space of your page with lines. Lines can be defined through the attribute, which is a string and contains the color, the style and the width of the line.
Style can be: solid, dash or dot.
Examples:
var style1 = stylesheet.addStyle("@page", "black solid 1");
var style2 = stylesheet.addStyle("@page", "green dash 0.5");