cancel
Showing results for 
Search instead for 
Did you mean: 

how to write each element of a set to the excel sheet?

Former Member
0 Kudos

I am trying to iterate through each element of the set and write each of them to an excel file? Can Somebody help me to achieve this?

Code snippet is:

Iterator<String> nameIterator = names.iterator();

  

  

    for(int size = 0;size<names.size();size++){       

  row = mdm_lastLoginDate.createRow(size);

  //cell = row.createCell(1);

  while(nameIterator.hasNext()){

  String setName = nameIterator.next();

  cell = row.createCell(1);

  cell.setCellValue(setName);

  System.out.println("setName:->"+setName);

  }

  mdm_lastLoginDate.autoSizeColumn(size);

    }

above code prints each element in the console but not getting each value in the excel file. I am only getting the last value.

Thanks & regards

Amita

Accepted Solutions (0)

Answers (1)

Answers (1)

Vlado
Advisor
Advisor
0 Kudos

As already communicated several times to you - please use the correct space for your posts.

I'll move this thread again to , however - and for the last time - please get familiar with and note that your account will be disabled if you repeatedly fail to follow them.


--Vlado (SCN Moderator)

Former Member
0 Kudos

I think this is the correct forum I am asking the question. This question is related to pure java, so I asked the question here? I don't understand why are you moving this thread to MDM?

-Amita

Vlado
Advisor
Advisor
0 Kudos

Since you haven't provided any background context (btw, also required by !), I tried to infer it from the only hint I could find in your code - mdm_lastLoginDate object.

If it's related to pure Java, note that is also not a general Java forum - it's about Java@SAP.