Senin, 14 Februari 2011

Kismiss Multi Row Header

At this section, we will learn how to draw multi rows at report header. For multi rows header we need to define the properties of getter method. The example code below show us how to multi header :

package com.softtech.kismiss.elevenExample;

import com.softtech.kismiss.enumer.CalculationType;
import com.softtech.kismiss.property.Header;
import com.softtech.kismiss.property.Calculation;
import com.softtech.kismiss.property.Kismiss;
import com.softtech.kismiss.property.Property;

/**
    * @author Kisman Hong
    * test Kismiss Reports
*/
@Kismiss(name = "Employee", columnAutoSize=true)
@Header(columnHeaderHeight=45, isColumnHeaderBold=true)
@Detail(lineWidth=0.5)
public class Employee {
    ...
    @Property(width = 100, position = 1, columnHierarchy={"NAME"}, heightPortion=     {15})
    public String getFirstName() {
      return firstName;
    }

    public void setFirstName(String firstName) {
      this.firstName = firstName;
    }

    @Property(width = 100, position = 2, columnHierarchy={"NAME"}, heightPortion={15})
    public String getLastName() {
      return lastName;
    }

    public void setLastName(String lastName) {
      this.lastName = lastName;
    }
    ...
}


By adding “columnHierarchy” at property, we tell kismiss to define parent field name, “heightPortion” indicate the height of the parent field.

Let us take a look to our report result :

Note :
Make sure the fields to be group in header have the position side by side.
We can add the header height by define “columnHeaderHeight” in Header tag.


Tidak ada komentar:

Posting Komentar