Set Text field from ObservableList [JavaFX]

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view

Set Text field from ObservableList [JavaFX]

Hello to all,

i'm tryng to generate one excel file from ObservableList by adding one
column like Text because without this paramiter in this specific column I
can loose some informations.

field MainTableGlobalWip  is -->   @FXML private
TableView<ListTableGlobalWip> MainTableGlobalWip;
field ListTableGlobalWip is ---> @FXML private
ObservableList<ListTableGlobalWip> data ;

below is possible to see the code which I'm using to generate the excel file
by using Apache POI 4.1

XSSFWorkbook workbook = new XSSFWorkbook();
        XSSFCellStyle textFormatStyle = workbook.createCellStyle();
        XSSFSheet masterDataSheet= workbook.createSheet("Master_Data");
        XSSFRow firstRow= masterDataSheet.createRow(0);
        XSSFRow row  = null;
        //XSSFCell cell =row.createCell(0);
        public void ExportXlsx(ActionEvent actionEvent) throws IOException  {
                //prelevo le intestazioni delle colonne
                for (int i=0; i<MainTableGlobalWip.getColumns().size();i++) {
                //inizio a prelevare i vari record dalla tabella e li trasferisco
all'interno del file EXEL
                for(int row=0; row&lt;MainTableGlobalWip.getItems().size();row++){
            XSSFRow xssfRow= masterDataSheet.createRow(row+1);
            for (int col=0; col&lt;MainTableGlobalWip.getColumns().size();
            Object celValue =
            try {
            if (celValue != null &amp;&amp;
Double.parseDouble(celValue.toString()) != 0.0) {
                     }catch(NumberFormatException e){

someone could help me to put the column 16 like text for don't loos the

Sent from:

To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]