简体   繁体   中英

Start the table from a specific column excel apache poi

I'm having a problem in excel while using Apache POI. I can create rows, but sometimes I'm in a situation where I would like to start from a particular column only.

So is it possible to start any particular column like the 'C' column Instead of the column 'A' Always.

I'm using the Java language for this.

Sheet sheet = workbook.createSheet("Sheet 1");
  Row header = sheet.createRow(0);
  header.createCell(0).setCellValue("Header 1");

Click here to see image of excel file

Looks like you provide the number of column as a parameter and in your case this is column #0. If you would like to work with third column just change the number of column: header.createCell(2).setCellValue("Header 1");

More about usage of this method you can read in javadoc here .

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM