report.setName("JFritz!  -  FRITZ!Box Anrufliste");
report.setName("JFritz-Anrufliste");
    public JFreeReport createReportDefinition() {        report = new JFreeReport();        report.setName("JFritz!  -  FRITZ!Box Anrufliste");        SimplePageDefinition pageDefinition = new SimplePageDefinition(                createDINA4PaperLandscape());        report.setPageDefinition(pageDefinition);        createColumnWidths();        report.setPageHeader(createPageHeader(report.getPageDefinition()                .getWidth()));        TextFieldElementFactory factory;        final Image callInImage = Toolkit.getDefaultToolkit().getImage(                getClass().getResource(                        "/de/moonflower/jfritz/resources/images/callin.png"));        final Image callInFailedImage = Toolkit                .getDefaultToolkit()                .getImage(                        getClass()                                .getResource(                                        "/de/moonflower/jfritz/resources/images/callinfailed.png"));        final Image callOutImage = Toolkit.getDefaultToolkit().getImage(                getClass().getResource(                        "/de/moonflower/jfritz/resources/images/callout.png"));        AbstractExpression exp = new AbstractExpression() {            public Object getValue() {                Object ob = getDataRow().get(                        jfritz.getCallerlist().getColumnName(0));                if (ob == null)                    return null;                CallType callType = (CallType) ob;                switch (callType.calltype) {                case CallType.CALLIN:                    return callInImage;                case CallType.CALLIN_FAILED:                    return callInFailedImage;                case CallType.CALLOUT:                    return callOutImage;                default:                    return null;                }            };        };        exp.setName("print_type");        report.addExpression(exp);        // Set Font size to 8        Integer fontSize = new Integer(8);        ImageElement imageElement = ImageFieldElementFactory                .createImageDataRowElement("Type-Element",                        new Rectangle2D.Float(columnStart[0] + 2, 2, 14, 14),                        "print_type", true, false);        imageElement.setDynamicContent(false);        report.getItemBand().addElement(imageElement);        ShapeElement selement = StaticShapeElementFactory                .createRectangleShapeElement("back", Color.decode("#000000"),                        new BasicStroke(0), new Rectangle2D.Float(                                columnStart[0], 0, columnWidth[0], 18), true,                        false);        report.getItemBand().addElement(selement);        // Drucke Datum        factory = new DateFieldElementFactory();        factory.setFontSize(fontSize);        factory.setName(jfritz.getCallerlist().getColumnName(1));        factory.setAbsolutePosition(new Point2D.Float(columnStart[1], 2));        factory.setMinimumSize(new Dimension(columnWidth[1], 14));        factory.setMaximumSize(new Dimension(100, 14));        factory.setColor(Color.black);        factory.setHorizontalAlignment(ElementAlignment.CENTER);        factory.setVerticalAlignment(ElementAlignment.MIDDLE);        factory.setNullString("-");        factory.setFieldname(jfritz.getCallerlist().getColumnName(1));        report.getItemBand().addElement(factory.createElement());        selement = StaticShapeElementFactory.createRectangleShapeElement(                "back", Color.BLACK, new BasicStroke(0), new Rectangle2D.Float(                        columnStart[1], 0, columnWidth[1], 18), true, false);        report.getItemBand().addElement(selement);        if (JFritzUtils.parseBoolean(JFritz.getProperty(                "option.showCallByCall", "false"))) {            // Drucke CallByCall            factory = new TextFieldElementFactory();            factory.setFontSize(fontSize);            factory.setName(jfritz.getCallerlist().getColumnName(2));            factory.setAbsolutePosition(new Point2D.Float(columnStart[2], 2));            factory.setMinimumSize(new Dimension(columnWidth[2], 14));            factory.setColor(Color.BLACK);            factory.setHorizontalAlignment(ElementAlignment.CENTER);            factory.setVerticalAlignment(ElementAlignment.MIDDLE);            factory.setNullString(" ");            factory.setFieldname(jfritz.getCallerlist().getColumnName(2));            report.getItemBand().addElement(factory.createElement());            selement = StaticShapeElementFactory                    .createRectangleShapeElement("back", Color.BLACK,                            new BasicStroke(0), new Rectangle2D.Float(                                    columnStart[2], 0, columnWidth[2], 18),                            true, false);            report.getItemBand().addElement(selement);        }        // Drucke Rufnummer        exp = new AbstractExpression() {            public Object getValue() {                Object number = getDataRow().get(                        jfritz.getCallerlist().getColumnName(3));                return number.toString();            };        };        exp.setName("print_number");        report.addExpression(exp);        // Drucke Person (Fullname)        exp = new AbstractExpression() {            public Object getValue() {                Object person = getDataRow().get(                        jfritz.getCallerlist().getColumnName(4));                if (person == null)                    return null;                return ((Person) person).getFullname();            };        };        exp.setName("print_personname");        report.addExpression(exp);        // Drucke Port        exp = new AbstractExpression() {            public Object getValue() {                Object obj = getDataRow().get(                        jfritz.getCallerlist().getColumnName(5));                if (obj == null)                    return null;                String port = (String) obj;                String portStr = "";                if (port.equals("4"))                    portStr = "ISDN";                else if (port.equals("0"))                    portStr = "FON 1";                else if (port.equals("1"))                    portStr = "FON 2";                else if (port.equals("2"))                    portStr = "FON 3";                else if (port.equals(""))                    portStr = "";                else                    portStr = "Port " + port;                return portStr;            };        };        exp.setName("print_port");        report.addExpression(exp);        // Drucke Route        exp = new AbstractExpression() {            public Object getValue() {                Object obj = getDataRow().get(                        jfritz.getCallerlist().getColumnName(6));                if (obj == null)                    return null;                String route = (String) obj;                return route;            };        };        exp.setName("print_route");        report.addExpression(exp);        // Drucke Dauer        exp = new AbstractExpression() {            public Object getValue() {                Object obj = getDataRow().get(                        jfritz.getCallerlist().getColumnName(7));                if (obj == null)                    return null;                int duration = Integer.parseInt(obj.toString());                return Integer.toString(duration / 60) + " min";            };        };        exp.setName("print_duration");        report.addExpression(exp);        // Drucke Kosten        exp = new AbstractExpression() {            public Object getValue() {                Object obj = getDataRow().get(                        jfritz.getCallerlist().getColumnName(8));                if (obj == null)                    return null;                if (Double.parseDouble(obj.toString()) == -1) {                    return "Unbekannt";                } else if (Double.parseDouble(obj.toString()) == -2) {                    return "Freiminuten";                } else                    return obj.toString() + " ct";            };        };        exp.setName("print_cost");        report.addExpression(exp);        for (int i = 3; i < jfritz.getCallerlist().getColumnCount(); i++) {            factory = new TextFieldElementFactory();            factory.setFontSize(fontSize);            factory.setName(jfritz.getCallerlist().getColumnName(i));            factory.setAbsolutePosition(new Point2D.Float(columnStart[i], 2));            factory.setMinimumSize(new Dimension(columnWidth[i], 14));            factory.setColor(Color.black);            factory.setHorizontalAlignment(ElementAlignment.CENTER);            factory.setVerticalAlignment(ElementAlignment.MIDDLE);            factory.setNullString(" ");            switch (i) {            case 3:                factory.setFieldname("print_number");                break;            case 4:                factory.setFieldname("print_personname");                break;            case 5:                factory.setFieldname("print_port");                break;            case 6:                factory.setFieldname("print_route");                break;            case 7:                factory.setFieldname("print_duration");                break;            case 8:                factory.setFieldname("print_cost");                break;            default: {            }            }            report.getItemBand().addElement(factory.createElement());            selement = StaticShapeElementFactory                    .createRectangleShapeElement("back", Color                            .decode("#000000"), new BasicStroke(0),                            new Rectangle2D.Float(columnStart[i], 0,                                    columnWidth[i], 18), true, false);            report.getItemBand().addElement(selement);        }        return report;    }