Hallo,
Ich habe eine Excel-Datei via POI erstellt und will nun die Überschrift vertikal anzeigen.
Desweiteren sollen in einer Folgezeile bestimmte Spalten miteinander verbunden werden.
Folgendes Coding im Anfangsstadium habe ich derzeit, es folgt noch die Ausgabe und das Einstellen der Daten einer DB.
Leider funktioniert die Anzeige vertikal bei "cell0" nicht. Der Text wird nur mittig angeordnet aber nicht vertikal.
Hat jemand einen Tip was ich falsch mache?
Vorab vielen Dank.
LG
Floyd
L-ectron-X hat Code-Tags gesetzt.
Ich habe eine Excel-Datei via POI erstellt und will nun die Überschrift vertikal anzeigen.
Desweiteren sollen in einer Folgezeile bestimmte Spalten miteinander verbunden werden.
Folgendes Coding im Anfangsstadium habe ich derzeit, es folgt noch die Ausgabe und das Einstellen der Daten einer DB.
Leider funktioniert die Anzeige vertikal bei "cell0" nicht. Der Text wird nur mittig angeordnet aber nicht vertikal.
Hat jemand einen Tip was ich falsch mache?
Code:
package liste;
import java.io.FileOutputStream;
import org.apache.poi.hssf.usermodel.HSSFCell;
import org.apache.poi.hssf.usermodel.HSSFCellStyle;
import org.apache.poi.hssf.usermodel.HSSFRow;
import org.apache.poi.hssf.usermodel.HSSFSheet;
import org.apache.poi.hssf.usermodel.HSSFWorkbook;
public class Excelliste{
public static void main(String[] args)
{
try
{
HSSFWorkbook wb = new HSSFWorkbook();
HSSFSheet sheet1 = wb.createSheet("Antragsübersicht");
HSSFCellStyle style = wb.createCellStyle();
style.setVerticalAlignment(HSSFCellStyle.VERTICAL_CENTER);
HSSFRow row = sheet1.createRow((short)0); // Create a row and put some cells in it. Rows are 0
based.
HSSFCell cell0 = row.createCell((short)0); // Create a cell and put a value in it.
cell0.setCellValue("Zweigstelle");
cell0.setCellStyle(style);
HSSFCell cell1 = row.createCell((short)1);
cell1.setCellValue("Bündel-PHV");
HSSFCell cell2 = row.createCell((short)2);
cell2.setCellValue("Bündel-VHV/VGV");
HSSFCell cell3 = row.createCell((short)3);
cell3.setCellValue("Gebäude");
HSSFCell cell4 = row.createCell((short)4);
cell4.setCellValue("Hausrat");
HSSFCell cell5 = row.createCell((short)5);
cell5.setCellValue("Kraftfahrt");
HSSFCell cell6 = row.createCell((short)6);
cell6.setCellValue("Privathaftpflicht");
HSSFCell cell7 = row.createCell((short)7);
cell7.setCellValue("Unfall");
HSSFCell cell8 = row.createCell((short)8);
cell8.setCellValue("Zwischensumme Komposit");
HSSFCell cell9 = row.createCell((short)9);
cell9.setCellValue("Kapitalleben");
HSSFCell cell10 = row.createCell((short)10);
cell10.setCellValue("Rentenversicherrung");
HSSFCell cell11 = row.createCell((short)11);
cell11.setCellValue("Risikoleben");
HSSFCell cell12 = row.createCell((short)12);
cell12.setCellValue("S-PrivatRente");
HSSFCell cell13 = row.createCell((short)13);
cell13.setCellValue("Sterbegeld");
HSSFCell cell14 = row.createCell((short)14);
cell14.setCellValue("Zwischensumme Leben");
HSSFCell cell15 = row.createCell((short)15);
cell15.setCellValue("Restkredit");
HSSFCell cell16 = row.createCell((short)16);
cell16.setCellValue("Gesamt");
FileOutputStream fileOut = new FileOutputStream("X:/Geraldy/TestExcelliste.xls");
wb.write(fileOut);
fileOut.close();
}
catch(Exception e)
{
}
}
}
Vorab vielen Dank.
LG
Floyd
L-ectron-X hat Code-Tags gesetzt.