expression = new JRDesignExpression();
expression.setValueClass(java.lang.String.class);
expression.setText("\" \" + String.valueOf($V{CityNumber}) + \". \" + String.valueOf($F{City})");
textField.setExpression(expression);
band.addElement(textField);
JRDesignLine line = new JRDesignLine();
line.setX(0);
line.setY(19);
line.setWidth(515);
line.setHeight(0);
band.addElement(line);
((JRDesignSection)group.getGroupHeaderSection()).addBand(band);
band = new JRDesignBand();
band.setHeight(20);
line = new JRDesignLine();
line.setX(0);
line.setY(-1);
line.setWidth(515);
line.setHeight(0);
band.addElement(line);
JRDesignStaticText staticText = new JRDesignStaticText();
staticText.setX(400);
staticText.setY(0);
staticText.setWidth(60);
staticText.setHeight(15);
staticText.setHorizontalAlignment(HorizontalAlignEnum.RIGHT);
staticText.setStyle(boldStyle);
staticText.setText("Count : ");
band.addElement(staticText);
textField = new JRDesignTextField();
textField.setX(460);
textField.setY(0);
textField.setWidth(30);
textField.setHeight(15);
textField.setHorizontalAlignment(HorizontalAlignEnum.RIGHT);
textField.setStyle(boldStyle);
expression = new JRDesignExpression();
expression.setValueClass(java.lang.Integer.class);
expression.setText("$V{CityGroup_COUNT}");
textField.setExpression(expression);
band.addElement(textField);
((JRDesignSection)group.getGroupFooterSection()).addBand(band);
jasperDesign.addGroup(group);
//Title
band = new JRDesignBand();
band.setHeight(50);
line = new JRDesignLine();
line.setX(0);
line.setY(0);
line.setWidth(515);
line.setHeight(0);
band.addElement(line);
textField = new JRDesignTextField();
textField.setBlankWhenNull(true);
textField.setX(0);
textField.setY(10);
textField.setWidth(515);
textField.setHeight(30);
textField.setHorizontalAlignment(HorizontalAlignEnum.CENTER);
textField.setStyle(normalStyle);
textField.setFontSize(22);
expression = new JRDesignExpression();
expression.setValueClass(java.lang.String.class);
expression.setText("$P{ReportTitle}");
textField.setExpression(expression);
band.addElement(textField);
jasperDesign.setTitle(band);
//Page header
band = new JRDesignBand();
band.setHeight(20);
JRDesignFrame frame = new JRDesignFrame();
frame.setX(0);
frame.setY(5);
frame.setWidth(515);
frame.setHeight(15);
frame.setForecolor(new Color(0x33, 0x33, 0x33));
frame.setBackcolor(new Color(0x33, 0x33, 0x33));
frame.setMode(ModeEnum.OPAQUE);
band.addElement(frame);
staticText = new JRDesignStaticText();
staticText.setX(0);
staticText.setY(0);
staticText.setWidth(55);
staticText.setHeight(15);
staticText.setForecolor(Color.white);
staticText.setBackcolor(new Color(0x33, 0x33, 0x33));
staticText.setMode(ModeEnum.OPAQUE);
staticText.setHorizontalAlignment(HorizontalAlignEnum.CENTER);
staticText.setStyle(boldStyle);
staticText.setText("ID");
frame.addElement(staticText);
staticText = new JRDesignStaticText();
staticText.setX(55);
staticText.setY(0);
staticText.setWidth(205);
staticText.setHeight(15);
staticText.setForecolor(Color.white);
staticText.setBackcolor(new Color(0x33, 0x33, 0x33));
staticText.setMode(ModeEnum.OPAQUE);
staticText.setStyle(boldStyle);
staticText.setText("Name");
frame.addElement(staticText);
staticText = new JRDesignStaticText();
staticText.setX(260);
staticText.setY(0);
staticText.setWidth(255);
staticText.setHeight(15);
staticText.setForecolor(Color.white);
staticText.setBackcolor(new Color(0x33, 0x33, 0x33));
staticText.setMode(ModeEnum.OPAQUE);
staticText.setStyle(boldStyle);
staticText.setText("Street");
frame.addElement(staticText);
jasperDesign.setPageHeader(band);
//Column header
band = new JRDesignBand();
jasperDesign.setColumnHeader(band);
//Detail
band = new JRDesignBand();
band.setHeight(20);
textField = new JRDesignTextField();
textField.setX(0);
textField.setY(4);
textField.setWidth(50);
textField.setHeight(15);
textField.setHorizontalAlignment(HorizontalAlignEnum.RIGHT);
textField.setStyle(normalStyle);
expression = new JRDesignExpression();
expression.setValueClass(java.lang.Integer.class);
expression.setText("$F{Id}");
textField.setExpression(expression);
band.addElement(textField);
textField = new JRDesignTextField();
textField.setStretchWithOverflow(true);
textField.setX(55);
textField.setY(4);
textField.setWidth(200);
textField.setHeight(15);
textField.setPositionType(PositionTypeEnum.FLOAT);
textField.setStyle(normalStyle);
expression = new JRDesignExpression();
expression.setValueClass(java.lang.String.class);
expression.setText("$F{FirstName} + \" \" + $F{LastName}");
textField.setExpression(expression);
band.addElement(textField);
textField = new JRDesignTextField();
textField.setStretchWithOverflow(true);
textField.setX(260);
textField.setY(4);
textField.setWidth(255);
textField.setHeight(15);
textField.setPositionType(PositionTypeEnum.FLOAT);
textField.setStyle(normalStyle);
expression = new JRDesignExpression();
expression.setValueClass(java.lang.String.class);
expression.setText("$F{Street}");
textField.setExpression(expression);
band.addElement(textField);
line = new JRDesignLine();
line.setX(0);
line.setY(19);
line.setWidth(515);
line.setHeight(0);
line.setForecolor(new Color(0x80, 0x80, 0x80));
line.setPositionType(PositionTypeEnum.FLOAT);
band.addElement(line);
((JRDesignSection)jasperDesign.getDetailSection()).addBand(band);
//Column footer
band = new JRDesignBand();