for(int periods=0; periods<3; periods++){
String weekDay = new SimpleDateFormat("EEEEE").format(new GDDate(date).getDate()).replace("-feira", "");
if(getHourVacancy(weekDay, ((periods+1)*6)+1, ((2+periods)*6))>0){
posX = convert(10);
JRPrintRectangle rectangle = new JRBasePrintRectangle(jasperPrint.getDefaultStyleProvider());
rectangle.setX(posX);
rectangle.setY(posY);
rectangle.setWidth(535);
rectangle.setHeight(14);
rectangle.setBackcolor(new Color(153, 153, 153));
page.addElement(rectangle);
text = new JRBasePrintText(jasperPrint.getDefaultStyleProvider());
text.setText(period.get(periods));
text.setX(posX);
text.setY(posY);
text.setWidth(535);
text.setHeight(14);
text.setHorizontalAlignment(JRAlignment.HORIZONTAL_ALIGN_CENTER);
text.setLineSpacingFactor(2.0f);
text.setLeadingOffset(-4.0f);
text.setStyle(boldStyle);
page.addElement(text);
posY += 14;
int posYTemp = 0;
for(int hour=(((periods+1)*6)+1); hour<=((2+periods)*6); hour++){
if(getMaxVacancy(weekDay, hour)>0){
// if(!isHourVacancy(j)){
int numberOfColumns = getHourVacancy(weekDay, ((periods+1)*6)+1, ((2+periods)*6));
int width = Math.round(535/numberOfColumns);
rectangle = new JRBasePrintRectangle(jasperPrint.getDefaultStyleProvider());
rectangle.setX(posX);
rectangle.setY(posY);
rectangle.setWidth(width);
rectangle.setHeight(14);
rectangle.setBackcolor(new Color(204, 204, 204));
page.addElement(rectangle);
text = new JRBasePrintText(jasperPrint.getDefaultStyleProvider());
text.setText(String.valueOf(hour));
text.setX(posX);
text.setY(posY);
text.setWidth(width);
text.setHeight(14);
text.setHorizontalAlignment(JRAlignment.HORIZONTAL_ALIGN_CENTER);
text.setLineSpacingFactor(2.0f);
text.setLeadingOffset(-4.0f);
text.setStyle(boldStyle);
page.addElement(text);
posYTemp =posY;
for (int box = 0; box < numberTotalComputers; box++) {
posYTemp +=14;
rectangle = new JRBasePrintRectangle(jasperPrint.getDefaultStyleProvider());
rectangle.setX(posX);
rectangle.setY(posYTemp);
rectangle.setWidth(width);
rectangle.setHeight(14);
page.addElement(rectangle);
JRPrintLine line = new JRBasePrintLine(jasperPrint.getDefaultStyleProvider());
line.setX(posX+14);
line.setY(posYTemp);