0

I'm writing to an existing xlsx file using Apache POI. The code updates the value in two columns, and depending on the input it may update the value for more than 1 row as well. As you can see, after my code execution, it is supposed to enter values in PassedLinks and PassedImages columns.

util.setData(sheetName, "PassedLinks", Serial, pass+"/"+ulinks.size());
util.setData(sheetName, "PassedImages", Serial, pass+"/"+uimages.size());

But, it is not being done properly. It never updates the PassedLinks column, and sometimes it updates only the PassedImages column, that too only one of them. The method setData() correctly updates the data when we unit tested it, that too onto any column we provide. Another, probably unrelated, problem with this is that the file size grows huge even when a single cell is updated. It grows from say, 7KB to 54KB or so.

This is how the Spreadsheet looks

asked Oct 11, 2016 at 10:48

1 Answer 1

1

Figured it out. We were opening the FileOutputStream with append as true. This has caused the file size to increase, as well as to write only the latest data.

answered Oct 11, 2016 at 13:08

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.