# KugarTemplate template elements

Section bands | Section elements
`ReportHeader` | `Line`
`PageHeader` | `Label`
`DetailHeader` | `Field`
`Detail` | `CalculatedField`
`DetailFooter` | `Special`
`PageFooter` | Page Footer
`ReportFooter` | Report Footer

## `ReportHeader` and `ReportFooter` sections

The `ReportHeader` and `ReportFooter` elements define report sections that are usually printed at the beginning and end of the report.

    <!ELEMENT ReportHeader (Line*, Label*, Special*)>
    <!ATTLIST ReportHeader
         Height          CDATA #REQUIRED
         PrintFrequency  CDATA #REQUIRED>

    <!ELEMENT ReportFooter (Line*, Label*, Special*, CalculatedField*)>
    <!ATTLIST ReportFooter
         Height         CDATA #REQUIRED
         PrintFrequency CDATA #REQUIRED>

Attributes

- `Height`

- Sets the height of the report section. If you don't want this,section set this value to `0`.

`PrintFrequency`

- Set the print frequency of the section.

  Value | Print Frequency
  `0` | First Page
  `1` | Every Page
  `2` | Last Page

## `PageHeader` and `PageFooter` sections

The `PageHeader` and `PageFooter` elements define report sections that are usually printed on every page of the report.

    <!ELEMENT PageHeader (Line*, Label*, Special*)>
    <!ATTLIST PageHeader
         Height          CDATA #REQUIRED
         PrintFrequency  CDATA #REQUIRED>

    <!ELEMENT PageFooter (Line*, Label*, Special*)>
    <!ATTLIST PageFooter
         Height          CDATA #REQUIRED
         PrintFrequency  CDATA #REQUIRED>

Attributes

- `Height`

- Sets the height of the report section. If you don't want this,section set this value to `0`.

`PrintFrequency`

- Set the print frequency of the section.

  Value | Print Frequency
  `0` | First Page
  `1` | Every Page
  `2` | Last Page

## `DetailHeader` and `DetailFooter` sections

The `DetailHeader` and `DetailFooter` elements define report sections that are printed before and after details of a given level and below on the report.

    <!ELEMENT DetailHeader (Line*, Label*, Special*)>
    <!ATTLIST DetailHeader
         Height          CDATA #REQUIRED
         Level           CDATA #REQUIRED>

    <!ELEMENT DetailFooter (Line*, Label*, Special*)>
    <!ATTLIST DetailFooter
         Height          CDATA #REQUIRED
         Level           CDATA #REQUIRED>

Attributes

- `Height`

- Sets the height of the report section. If you don't want this,section set this value to `0`.

`Level`

- Set the hierarchy level of the section. Sections with higher levels will be printed before sections with lower ones. Level can be any number beginning from 0.

## `Detail` section

The `Detail` element defines the report section that contains the report data. The report can have multiple details, which are accessed by the detail's Level attribute.

    <!ELEMENT Detail (Line*, Label*, Special*, Field*)>
    <!ATTLIST Detail
         Height  CDATA   #REQUIRED
         Level   CDATA   #REQUIRED>

Attributes

- `Height`

- Sets the height of the report section. If you don't want this,section set this value to `0`.

`Level`

- Set the hierarchy level of the section. Sections with higher levels will be printed before sections with lower ones. Level can be any number beginning from 0. This is an attribute from a `row` element in a data file.

## `Line`

The `Line` element defines a report object used to draw lines on a report.

    <!ELEMENT Line EMPTY>
    <!ATTLIST Line
         X1     CDATA #REQUIRED
         Y1     CDATA #REQUIRED
         X2     CDATA #REQUIRED
         Y2     CDATA #REQUIRED
         Width  CDATA #REQUIRED
         Color  CDATA #REQUIRED
         Style  CDATA #REQUIRED>

Attributes

- `X1`

- Sets the starting x coordinate (relative to the section's upper left corner) for the line.

`Y1`

- Sets the starting y coordinate (relative to the section's upper left corner) for the line.

`X2`

- Sets the ending x coordinate (relative to the section's upper left corner) for the line.

`Y2`

- Sets the ending y coordinate (relative to the section's upper left corner) for the line.

`Width`

- Sets the width of the line.

`Color`

- Sets the color of the line. The color is defined as an RGB (Red Green Blue) value (r,g,b). r, g and b must be in the range 0..255.

`Style`

- Sets the drawing style for the line.

  Value | Line Style
  `0` | No Pen
  `1` | Solid
  `2` | Dash
  `3` | Dot
  `4` | Dash Dot
  `5` | Dash Dot Dot

## `Label`

The `Label` element defines a report object used to draw fixed text on a report.

     <!ELEMENT Label EMPTY>
     <!ATTLIST Label
         Text            CDATA #REQUIRED
         X               CDATA #REQUIRED
         Y               CDATA #REQUIRED
         Width           CDATA #REQUIRED
         Height          CDATA #REQUIRED
         BackgroundColor CDATA #REQUIRED
         ForegroundColor CDATA #REQUIRED
         BorderColor     CDATA #REQUIRED
         BorderWidth     CDATA #REQUIRED
         BorderStyle     CDATA #REQUIRED
         FontFamily      CDATA #REQUIRED
         FontSize        CDATA #REQUIRED
         FontWeight      CDATA #REQUIRED
         FontItalic      CDATA #REQUIRED
         HAlignment      CDATA #REQUIRED
         VAlignment      CDATA #REQUIRED
         WordWrap        CDATA #REQUIRED>

Attributes

- `Text`

- Sets the label's text.

`X`

- Sets the x coordinate (relative to the section's upper left corner) for positioning the label.

`Y`

- Sets the y coordinate (relative to the section's upper left corner) for positioning the label.

`Width`

- Sets the width of the label.

`Height`

- Sets the height of the label.

`BackgroundColor`

- Sets the background color of the label. The color is defined as an RGB (Red Green Blue) value (r,g,b). r, g and b must be in the range 0..255.

`ForegroundColor`

- Sets the foreground color of the label. The color is defined as an RGB (Red Green Blue) value (r,g,b). r, g and b must be in the range 0..255.

`BorderColor`

- Sets the border color of the label. The color is defined as an RGB (Red Green Blue) value (r,g,b). r, g and b must be in the range 0..255.

`BorderWidth`

- Sets the border width for the label.

`BorderStyle`

- Sets the border style for the label.

  Value | Border Style
  `0` | None
  `1` | Solid
  `2` | Dash
  `3` | Dot
  `4` | Dash Dot
  `5` | Dash Dot Dot

`FontFamily`

- Sets the font family for the label's text.

`FontSize`

- Sets the font size for the label's text.

`FontWeight`

- Sets the font weight for the label's text.

  Value | Font Weight
  `25` | Light
  `50` | Normal
  `63` | Demi Bold
  `75` | Bold
  `87` | Black

`FontItalic`

- Sets the font italic flag for the label's text.

  Value | Italic
  `0` | False
  `1` | True

`HAlignment`

- Sets the label's horizontal text alignment.

  Value | Horizontal Alignment
  `0` | Left
  `1` | Center
  `2` | Right

`VAlignment`

- Sets the label's vertical text alignment.

  Value | Vertical Alignment
  `0` | Top
  `1` | Middle
  `2` | Bottom

`WordWrap`

- Sets the word wrap flag for the label's text.

  Value | Word Wrap
  `0` | False
  `1` | True

## `Field`

The `Field` element defines a report object used to draw data on a report.

    <!ELEMENT Field EMPTY>
    <!ATTLIST Field
         Field           CDATA #REQUIRED
         Text            CDATA #REQUIRED
         X               CDATA #REQUIRED
         Y               CDATA #REQUIRED
         Width           CDATA #REQUIRED
         Height          CDATA #REQUIRED
         BackgroundColor CDATA #REQUIRED
         ForegroundColor CDATA #REQUIRED
         BorderColor     CDATA #REQUIRED
         BorderWidth     CDATA #REQUIRED
         BorderStyle     CDATA #REQUIRED
         FontFamily      CDATA #REQUIRED
         FontSize        CDATA #REQUIRED
         FontWeight      CDATA #REQUIRED
         FontItalic      CDATA #REQUIRED
         HAlignment      CDATA #REQUIRED
         VAlignment      CDATA #REQUIRED
         WordWrap        CDATA #REQUIRED
         DataType        CDATA #REQUIRED
         DateFormat      CDATA #REQUIRED
         Precision       CDATA #REQUIRED
         Currency        CDATA #REQUIRED
         NegValueColor   CDATA #REQUIRED
         CommaSeparator  CDATA #REQUIRED>

Attributes

- `Field`

- Sets the data field for the object. This is an attribute from `row` element in a data file.

`Text`

- Not used.

`X`

- Sets the x coordinate (relative to the section's upper left corner) for positioning the field.

`Y`

- Sets the y coordinate (relative to the section's upper left corner) for positioning the field.

`Width`

- Sets the width of the field.

`Height`

- Sets the height of the field.

`BackgroundColor`

- Sets the background color of the field. The color is defined as an RGB (Red Green Blue) value (r,g,b). r, g and b must be in the range 0..255.

`ForegroundColor`

- Sets the foreground color of the field. The color is defined as an RGB (Red Green Blue) value (r,g,b). r, g and b must be in the range 0..255.

`BorderColor`

- Sets the border color of the field. The color is defined as an RGB (Red Green Blue) value (r,g,b). r, g and b must be in the range 0..255.

`BorderWidth`

- Sets the border width for the field.

`BorderStyle`

- Sets the border style for the field.

  Value | Border Style
  `0` | None
  `1` | Solid
  `2` | Dash
  `3` | Dot
  `4` | Dash Dot
  `5` | Dash Dot Dot

`FontFamily`

- Sets the font family for the field's text.

`FontSize`

- Sets the font size for the field's text.

`FontWeight`

- Sets the font weight for the field's text.

  Value | Font Weight
  `25` | Light
  `50` | Normal
  `63` | Demi Bold
  `75` | Bold
  `87` | Black

`FontItalic`

- Sets the font italic flag for the field's text.

  Value | Italic
  `0` | False
  `1` | True

`HAlignment`

- Sets the field's horizontal text alignment.

  Value | Horizontal Alignment
  `0` | Left
  `1` | Center
  `2` | Right

`VAlignment`

- Sets the field's vertical text alignment

  Value | Vertical Alignment
  `0` | Top
  `1` | Middle
  `2` | Bottom

`WordWrap`

- Sets the word wrap flag for the field's text.

  Value | Word Wrap
  `0` | False
  `1` | True

`DataType`

- Sets the field's data type.

  Value | Data Type
  `0` | String
  `1` | Integer
  `2` | Float
  `3` | Date
  `4` | Currency

`DateFormat`

- Sets the field's date format. For this to work, the format of the date from the data document must be in the format mm/dd/yyyy or mm-dd-yyyy, otherwise the original date format is used. If data type other than date, set to `0`.

  Value | Date Format
  `0` | m/d/yy
  `1` | m-d-yy
  `2` | mm/dd/yy
  `3` | mm-dd-yy
  `4` | m/d/yyyy
  `5` | m-d-yyyy
  `6` | mm/dd/yyyy
  `7` | mm-dd-yyyy
  `8` | yyyy/m/d
  `9` | yyyy-m-d
  `10` | dd.mm.yy
  `11` | dd.mm.yyyy

`Precision`

- Sets the field's numeric precision. If data type other than a numeric type, set to 0.

`Currency`

- Sets the field's currency symbol If data type other than currency, set to `36` ($). The value is a number representing a Unicode character.

`NegValueColor`

- Sets the color for negative numeric values. The color is defined as an RGB (Red Green Blue) value (r,g,b). r, g and b must be in the range 0..255. If data is other than a numeric type, set to 255,0,0.

`CommaSeparator`

- Sets whether commas are used in numeric fields. If data type other than a numeric type, set to `0`.

  Value | Comma Separator
  `0` | False
  `1` | True

## `CalculatedField`

The `CalculatedField` element defines a report object used to draw calculated values on a report.

    <!ELEMENT CalculatedField EMPTY>
    <!ATTLIST CalculatedField
         CalculationType CDATA #REQUIRED
         Field           CDATA #REQUIRED
         Text            CDATA #REQUIRED
         X               CDATA #REQUIRED
         Y               CDATA #REQUIRED
         Width           CDATA #REQUIRED
         Height          CDATA #REQUIRED
         BackgroundColor CDATA #REQUIRED
         ForegroundColor CDATA #REQUIRED
         BorderColor     CDATA #REQUIRED
         BorderWidth     CDATA #REQUIRED
         BorderStyle     CDATA #REQUIRED
         FontFamily      CDATA #REQUIRED
         FontSize        CDATA #REQUIRED
         FontWeight      CDATA #REQUIRED
         FontItalic      CDATA #REQUIRED
         HAlignment      CDATA #REQUIRED
         VAlignment      CDATA #REQUIRED
         WordWrap        CDATA #REQUIRED
         DataType        CDATA #REQUIRED
         DateFormat      CDATA #REQUIRED
         Precision       CDATA #REQUIRED
         Currency        CDATA #REQUIRED
         NegValueColor   CDATA #REQUIRED
         CommaSeparator  CDATA #REQUIRED>

Attributes

- `CalculationType`

- Sets the calculation type for the field.

  Value | Calculation
  `0` | Count
  `1` | Sum
  `2` | Average
  `3` | Variance
  `4` | Std Deviation

`Field`

- Sets the data field for the object. This is an attribute from `row` element in a data file.

`Text`

- Not used.

`X`

- Sets the x coordinate (relative to the section's upper left corner) for positioning the field.

`Y`

- Sets the y coordinate (relative to the section's upper left corner) for positioning the field.

`Width`

- Sets the width of the field.

`Height`

- Sets the height of the field.

`BackgroundColor`

- Sets the background color of the field. The color is defined as an RGB (Red Green Blue) value (r,g,b). r, g and b must be in the range 0..255.

`ForegroundColor`

- Sets the foreground color of the field. The color is defined as an RGB (Red Green Blue) value (r,g,b). r, g and b must be in the range 0..255.

`BorderColor`

- Sets the border color of the field. The color is defined as an RGB (Red Green Blue) value (r,g,b). r, g and b must be in the range 0..255.

`BorderWidth`

- Sets the border width for the field.

`BorderStyle`

- Sets the border style for the field.

  Value | Border Style
  `0` | None
  `1` | Solid
  `2` | Dash
  `3` | Dot
  `4` | Dash Dot
  `5` | Dash Dot Dot

`FontFamily`

- Sets the font family for the field's text.

`FontSize`

- Sets the font size for the field's text.

`FontWeight`

- Sets the font weight for the field's text.

  Value | Font Weight
  `25` | Light
  `50` | Normal
  `63` | Demi Bold
  `75` | Bold
  `87` | Black

`FontItalic`

- Sets the font italic flag for the field's text.

  Value | Italic
  `0` | False
  `1` | True

`HAlignment`

- Sets the field's horizontal text alignment.

  Value | Horizontal Alignment
  `0` | Left
  `1` | Center
  `2` | Right

`VAlignment`

- Sets the field's vertical text alignment.

  Value | Vertical Alignment
  `0` | Top
  `1` | Middle
  `2` | Bottom

`WordWrap`

- Sets the word wrap flag for the field's text.

  Value | Word Wrap
  `0` | False
  `1` | True

`DataType`

- Sets the field's data type.

  Value | Data Type
  `0` | String
  `1` | Integer
  `2` | Float
  `3` | Date
  `4` | Currency

`DateFormat`

- Sets the field's date format. For this to work, the format of the date from the data document must be in the format mm/dd/yyyy or mm-dd-yyyy, otherwise the original date format is used. If data type other than date, set to `0`.

  Value | Date Format
  `0` | m/d/yy
  `1` | m-d-yy
  `2` | mm/dd/yy
  `3` | mm-dd-yy
  `4` | m/d/yyyy
  `5` | m-d-yyyy
  `6` | mm/dd/yyyy
  `7` | mm-dd-yyyy
  `8` | yyyy/m/d
  `9` | yyyy-m-d
  `10` | dd.mm.yy
  `11` | dd.mm.yyyy

`Precision`

- Sets the field's numeric precision. If data type other than a numeric type, set to 0.

`Currency`

- Sets the field's currency symbol If data type other than currency, set to `36` ($). The value is a number representing a Unicode character.

`NegValueColor`

- Sets the color for negative numeric values. The color is defined as an RGB (Red Green Blue) value (r,g,b). r, g and b must be in the range 0..255. If data is other than a numeric type, set to 255,0,0.

`CommaSeparator`

- Sets whether commas are used in numeric fields. If data type other than a numeric type, set to `0`.

  Value | Comma Separator
  `0` | False
  `1` | True

## `Special`

The `Special` element defines a report object used to draw page numbers and the current date on a report.

    <!ELEMENT Special EMPTY>
    <!ATTLIST Special
         Type            CDATA #REQUIRED
         Text            CDATA #REQUIRED
         X               CDATA #REQUIRED
         Y               CDATA #REQUIRED
         Width           CDATA #REQUIRED
         Height          CDATA #REQUIRED
         BackgroundColor CDATA #REQUIRED
         ForegroundColor CDATA #REQUIRED
         BorderColor     CDATA #REQUIRED
         BorderWidth     CDATA #REQUIRED
         BorderStyle     CDATA #REQUIRED
         FontFamily      CDATA #REQUIRED
         FontSize        CDATA #REQUIRED
         FontWeight      CDATA #REQUIRED
         FontItalic      CDATA #REQUIRED
         HAlignment      CDATA #REQUIRED
         VAlignment      CDATA #REQUIRED
         WordWrap        CDATA #REQUIRED
         DateFormat      CDATA #REQUIRED>

Attributes

- `Type`

- Sets the type of special object.

  Value | Type
  `0` | Current Date
  `1` | Page Number

`Text`

- Not used.

`X`

- Sets the x coordinate (relative to the section's upper left corner) for positioning the field.

`Y`

- Sets the y coordinate (relative to the section's upper left corner) for positioning the field.

`Width`

- Sets the width of the field.

`Height`

- Sets the height of the field.

`BackgroundColor`

- Sets the background color of the field. The color is defined as an RGB (Red Green Blue) value (r,g,b). r, g and b must be in the range 0..255.

`ForegroundColor`

- Sets the foreground color of the field. The color is defined as an RGB (Red Green Blue) value (r,g,b). r, g and b must be in the range 0..255.

`BorderColor`

- Sets the border color of the field. The color is defined as an RGB (Red Green Blue) value (r,g,b). r, g and b must be in the range 0..255.

`BorderWidth`

- Sets the border width for the field.

`BorderStyle`

- Sets the border style for the field.

  Value | Border Style
  `0` | None
  `1` | Solid
  `2` | Dash
  `3` | Dot
  `4` | Dash Dot
  `5` | Dash Dot Dot

`FontFamily`

- Sets the font family for the field's text.

`FontSize`

- Sets the font size for the field's text.

`FontWeight`

- Sets the font weight for the field's text.

  Value | Font Weight
  `25` | Light
  `50` | Normal
  `63` | Demi Bold
  `75` | Bold
  `87` | Black

`FontItalic`

- Sets the font italic flag for the field's text.

  Value | Italic
  `0` | False
  `1` | True

`HAlignment`

- Sets the field's horizontal text alignment.

  Value | Horizontal Alignment
  `0` | Left
  `1` | Center
  `2` | Right

`VAlignment`

- Sets the field's vertical text alignment.

  Value | Vertical Alignment
  `0` | Top
  `1` | Middle
  `2` | Bottom

`WordWrap`

- Sets the word wrap flag for the field's text.

  Value | Word Wrap
  `0` | False
  `1` | True

`DateFormat`

- Sets the field's date format. For this to work, the format of the date from the data document must be in the format mm/dd/yyyy or mm-dd-yyyy, otherwise the original date format is used. If data type other than date, set to `0`.

  Value | Date Format
  `0` | m/d/yy
  `1` | m-d-yy
  `2` | mm/dd/yy
  `3` | mm-dd-yy
  `4` | m/d/yyyy
  `5` | m-d-yyyy
  `6` | mm/dd/yyyy
  `7` | mm-dd-yyyy
  `8` | yyyy/m/d
  `9` | yyyy-m-d
  `10` | dd.mm.yy
  `11` | dd.mm.yyyy

`Precision`

- Sets the field's numeric precision. If data type other than a numeric type, set to 0.