1

I have a predefined excel file which is a kind of form where most of the information is already mentioned but I have to just enter the Name, Address, etc details from my application made in Java.

I can store the cell (like A12, B20, etc) and update those cells using Apache POI libraries and methods easily. But I want it to be dynamic. Like if the users changes the name cell from A12 to B12, the Java code should not be modified.

Is there a way we can store some vaiable name in the excel cell and update the value of that cell from Java ?

2 Answers 2

2

You can use CellReference

String sUserInput = "A1"; // A1 or whatever
CellReference ref = new CellReference (sUserInput);
ref.getRow ();
ref.getCol ();
Sign up to request clarification or add additional context in comments.

1 Comment

Thanks @LiuYan for the response. But I dont want the sUserInput = "A1" all the time. If the customer changes the template of the excel file(like change the field for total of the A column from A50 to A51), then there should not be any change in the java code.
0

You can write a cron job to read the excel file with a particular intervel and compare the cells values with the previous values.

Comments

Your Answer

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.