Forum Discussion

  • ZDGN's avatar
    ZDGN
    Contributor

    Hi shaikgayaz 

     

    Regarding your groovy script, it seems the cell coordinates never change:

     

    Label label = new Label(0, 1, holder.getNodeValue(xPath1));
    sheet.addCell(label);

     

    May be you should use a variable to manage either the column or row number.

     

    As you can see it in the documentation, the label take column and row number as parameters:

    Label(int c, int r, java.lang.String cont)
              Creates a cell which, when added to the sheet, will be presented at the specified column and row co-ordinates and will contain the specified text

     

    Here is an example:

    https://mkyong.com/java/jexcel-api-reading-and-writing-excel-file-in-java/

     

     

    Hope this will help.

     

    David.