* Creates an XLSX or an XLS type file using apache poi library depending on the extension.
* Only the first row of every sheet is initialized.
*/
public void createFile(LinkedList<String> tests) {
Workbook workbook = new HSSFWorkbook();
for (int cnt=0; cnt<tests.size(); cnt++) {
setColumns(tests.get(cnt));
Sheet sheet = workbook.createSheet("Test " + cnt);
Row row = sheet.createRow(0);
int counter = 2; //A counter which is used to determine how many additional columns are needed.
createCell(workbook, row, 0, "Grupa", CellStyle.ALIGN_CENTER, CellStyle.VERTICAL_CENTER);
createCell(workbook, row, 1, "Indeks", CellStyle.ALIGN_CENTER, CellStyle.VERTICAL_CENTER);
createCell(workbook, row, 2, "Naziv Fajla", CellStyle.ALIGN_CENTER, CellStyle.VERTICAL_CENTER);
if (bInput) {
createCell(workbook, row, counter+1, "Ulaz", CellStyle.ALIGN_CENTER, CellStyle.VERTICAL_CENTER);
counter++;
}
if (bOutput) {
createCell(workbook, row, counter+1, "Izlaz", CellStyle.ALIGN_CENTER, CellStyle.VERTICAL_CENTER);
counter++;
}
if (bTimeLimit) {
createCell(workbook, row, counter+1, "Vremensko Ogranicenje", CellStyle.ALIGN_CENTER, CellStyle.VERTICAL_CENTER);
counter++;
}
if (bMemory) {
createCell(workbook, row, counter+1, "Zauzece Memorije", CellStyle.ALIGN_CENTER, CellStyle.VERTICAL_CENTER);
counter++;
}
if (bCPUTime) {
createCell(workbook, row, counter+1, "CPU Vreme", CellStyle.ALIGN_CENTER, CellStyle.VERTICAL_CENTER);
counter++;
}
if (bThreadNumber) {
createCell(workbook, row, counter+1, "Broj Niti", CellStyle.ALIGN_CENTER, CellStyle.VERTICAL_CENTER);
counter++;
}
if (bHandlers) {
createCell(workbook, row, counter+1, "Rukovaoci Greskama", CellStyle.ALIGN_CENTER, CellStyle.VERTICAL_CENTER);
counter++;
}
if (bProcessID) {
createCell(workbook, row, counter+1, "Proces ID", CellStyle.ALIGN_CENTER, CellStyle.VERTICAL_CENTER);
counter++;
}
createCell(workbook, row, counter+1, "Uspesno/Neuspesno", CellStyle.ALIGN_CENTER, CellStyle.VERTICAL_CENTER);
createCell(workbook, row, counter+2, "Komentar", CellStyle.ALIGN_CENTER, CellStyle.VERTICAL_CENTER);
for (int i=0; i<counter+3; i++) {
sheet.autoSizeColumn(i);
}
}
try {
FileOutputStream fileOutput = new FileOutputStream(reportFile + ".xls");
workbook.write(fileOutput);
fileOutput.close();
} catch (FileNotFoundException e) {
// TODO Auto-generated catch block
e.printStackTrace();
} catch (IOException e) {