Create Excel file in Java

前端 未结 10 708
予麋鹿
予麋鹿 2020-12-02 15:23

I want to create an Excel file and write data just like writing a text file with Java. I tried to change file extension from .txt to .xls. But I wa

10条回答
  •  盖世英雄少女心
    2020-12-02 16:09

    To create a spreadsheet and format a cell using POI, see the Working with Fonts example, and use:

    font.setBoldweight(Font.BOLDWEIGHT_BOLD);
    

    POI works very well. There are some things you can't do (e.g. create VBA macros), but it'll read/write spreadsheets with macros, so you can create a suitable template sheet, read it and manipulate it with POI, and then write it out.

提交回复
热议问题