I am trying to create a .xls/.xlsx file using Java mapping in SAP PO 7.5 with values inside the file being semicolon separated.
I have attached the screenshot for input xml and output file as reference.
I am using DOM Parser to parse the input xml as below and then setting the value in the respective cells of the excel.
DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance(); DocumentBuilder builder = factory.newDocumentBuilder();
Document document = builder.parse(inputstream); NodeList nodelist = document.getElementsByTagName("ExchangeRate");
Please let me know how to add ; in between the different values fetched from the xml.
HSSFRow row1 = ITSFX.createRow(1);
cell = row1.createCell((short) 0);
cell.setCellValue(((Element) (nodelist.item(0))).getElementsByTagName("CurrencyFrom").item(0). getFirstChild() .getNodeValue());
Here i am getting the first value fetched from the xml i.e. EUR in this case.
Now i have to add the second value from the xml in the same cell [1,0] with semi colon as separator.