Zum Inhalt springen
View in the app

A better way to browse. Learn more.

Fachinformatiker.de

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Über Poi Bibliothek eine XLS datei erstellen! (umständlich)

Empfohlene Antworten

Veröffentlicht

Hi Leute,

ich erstelle über die POI Bibliothek eine Excel datei.

jetzt hab ich versucht in der createheader() Methode das Excel file zu füllen, was auch klappt!

Jedoch kommt es mir sehr umständlich vor, wie ich das mache!

kann mir einer Weiterhelfen, um das ganze zu vereinfachen?

private void createHeader(HSSFWorkbook book) {

HSSFRow row;
HSSFCell cell;
HSSFCellStyle style;
HSSFFont font;
short i=0;

style = book.createCellStyle();
font = book.createFont();
font.setFontHeightInPoints((short) 10);
font.setBoldweight(HSSFFont.BOLDWEIGHT_BOLD);
style.setFont(font);

row = book.getSheetAt(0).createRow(0);
cell = row.createCell(i);
cell.setCellStyle(style);
cell.setCellValue("MEDITsystems Juni 2006");

row = book.getSheetAt(0).createRow(4);
cell = row.createCell(i++);
cell.setCellValue("Mitarbeiter");

row = book.getSheetAt(0).createRow(4);
cell = row.createCell(i);
cell.setCellValue("Workflow");

row = book.getSheetAt(0).createRow(4);
cell = row.createCell((short)2);
cell.setCellValue("Differenz");

String[] array = {"Aouzi Abdelwahad","Bensch Heiko","Brodale Michael",
"Dalic Suzana","Demirci Selcuk","Duck Heike",
"Henkel Dr. Thomas","Neudorfer Stefan",
"Schimanowska Uljana","Springer Stefan"};

for(i=6;i<array.length+6; i++){
row = book.getSheetAt(0).createRow(i);
cell = row.createCell((short)0);
cell.setCellValue(array[i-6]);
}

i=19;
row = book.getSheetAt(0).createRow(i++);
cell = row.createCell((short)0);
cell.setCellValue("berechnet Vormonat");

row = book.getSheetAt(0).createRow(i++);
cell = row.createCell((short)0);
cell.setCellValue("Übertrag Vormonat");

row = book.getSheetAt(0).createRow(i++);
cell = row.createCell((short)0);
cell.setCellValue("Vertrag");

row = book.getSheetAt(0).createRow(i++);
cell = row.createCell((short)0);
cell.setCellValue("Rest");

row = book.getSheetAt(0).createRow(i++);
cell = row.createCell((short)0);
cell.setCellValue("Übertrag nächster Monat");



}[/PHP]

DANKE

MFG

MIKE

Archiv

Dieses Thema wurde archiviert und kann nicht mehr beantwortet werden.

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.