Комментарии:
Tried same code
But writing to second row not happening
It is replacing first row value
Can anyone help me out
Very clear explanation. Thankyou
ОтветитьFinally, a good video to understand the concept. went through all the links and videos but clearly the best video.
Ответитьhi bro I am getting this Exception " Exception in thread "main" java.lang.NullPointerException" can u tell me how to fix it
ОтветитьHow to Create a new Excel workbook. , please show us that too
ОтветитьExactly I was looking for 🤗
ОтветитьHi, How so save the excel file using Selenium after write and add some rows?
ОтветитьVery helpful. Thanks Mukesh :)
Ответитьpackage readexceldata;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.IOException;
import org.apache.poi.xssf.usermodel.XSSFSheet;
import org.apache.poi.xssf.usermodel.XSSFWorkbook;
public class WriteExcel2
{
File src;
XSSFWorkbook wb;
XSSFSheet sheet1;
public WriteExcel2()
{
try {
src = new File("C:\\eclipse-workspace\\TestData.xlsx");
FileInputStream fis= new FileInputStream(src);
wb = new XSSFWorkbook(fis);
} catch (Exception e) {
System.out.println(e.getMessage());
}
}
public String getData(int sheetnumber,int row,int column)
{
FileOutputStream fout=new FileOutputStream(src);
sheet1=wb.getSheetAt(sheetnumber);
<34> String data= sheet1.getRow(0).createCell(2).setCellValue("pass");
return data;
}
}
In this 34 line im getting this error"Type mismatch: cannot convert from void to String"..what to do sir
can u please share the code how to reuse this as u did in read excel in last video.. please im getting error
ОтветитьHello sir, I am geeting an exception {java.lang.NullPointerException: "Cannot invoke "org.apache.poi.xssf.usermodel.XSSFRow.createCell(int)" because the return value of "org.apache.poi.xssf.usermodel.XSSFSheet.getRow(int)" is null
at resources.RandomNumberTest.main(RandomNumberTest.java:29)}
please help
Nice videos. U should have explained both read and write in 1 video including 2 dimensional array values. U shown how to retrieve the data in single column.
Ответитьhey, I am getting error java.lang.NullPointerException while I was trying to write the data in excel sheet. I followed the same steps as you mentioned
ОтветитьThank you so much, Mukesh...You saved my day..
ОтветитьHow can I copy excel data and paste it into my web page? Is it possible using Apache POI,
If not then what concept we should use?
Please reply.
how to write data using column name and i need to write N number of rows
ОтветитьExcellent way of teaching.
ОтветитьHi Mukesh, how to write values from a refresh row in excel sheet?
ОтветитьI am running this code and getting an error of NoClassFoundException.... Can you please help me on this.
Ответить