Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package Excel;
- import java.io.File;
- import java.io.FileNotFoundException;
- import java.io.FileOutputStream;
- import java.io.IOException;
- import java.util.logging.Level;
- import java.util.logging.Logger;
- import org.apache.poi.ss.usermodel.CellStyle;
- import org.apache.poi.ss.usermodel.FillPatternType;
- import org.apache.poi.ss.usermodel.IndexedColors;
- import org.apache.poi.ss.usermodel.Workbook;
- import org.apache.poi.xssf.usermodel.XSSFCell;
- import org.apache.poi.xssf.usermodel.XSSFRow;
- import org.apache.poi.xssf.usermodel.XSSFSheet;
- import org.apache.poi.xssf.usermodel.XSSFWorkbook;
- public class Antes_Del_Traslado_Excel {
- private static final Logger LOGGER = Logger.getLogger("mx.com.hash.newexcel.Antes_Del_Traslado_Excel");
- public Antes_Del_Traslado_Excel() {
- try {
- File Excel = new File("Traslados.xlsx");
- XSSFWorkbook Libro=XSSFWorkbook.getWorkbook(Excel);
- XSSFSheet Hoja1= Libro.getSheetAt(0);
- XSSFRow Fila=Hoja1.createRow(0);
- XSSFCell Celda=Fila.createCell(2);
- Celda.setCellValue("Prueba");
- FileOutputStream Salid = new FileOutputStream(Excel);
- Libro.write(Salid);
- Salid.close();
- }catch (FileNotFoundException ex) {
- LOGGER.log(Level.SEVERE, "Archivo no localizable en sistema de archivos");
- }catch (IOException ex) {
- LOGGER.log(Level.SEVERE, "Error de entrada/salida");
- }
- }
- }
Add Comment
Please, Sign In to add comment