I'm using Apache POI to generate excel reports. But the properties of the excel file clearly mention that I have used Apache POI
. I want to mention my software name instead here
This is my current code, where I'm trying to set a custom property but it's not working.
XSSFWorkbook xlsxSetMetadata = new XSSFWorkbook();
xlsxSetMetadata.createSheet("Test sheet");
POIXMLProperties props = xlsxSetMetadata.getProperties();
POIXMLProperties.CoreProperties coreProp=props.getCoreProperties();
coreProp.setCreator("---------------");
coreProp.setDescription("Report");
coreProp.setKeywords("Report ");
coreProp.setTitle("... Report");
POIXMLProperties.ExtendedProperties extProp=props.getExtendedProperties();
extProp.getUnderlyingProperties().setCompany("XYX company");
extProp.getUnderlyingProperties().setTemplate("XSSF");
POIXMLProperties.CustomProperties custProp = props.getCustomProperties();
custProp.addProperty("Author", "..........");
custProp.addProperty("Program name", "MY_SOFTWARE_NAME_HERE");
String fname = "file_name.xlsx";
FileOutputStream out = new FileOutputStream(fname);
xlsxSetMetadata.write(out);
out.close();
How can I change the program name
property to my program name ??