Dear All,
i am using jdeveloper version of 12.1.3.0 and poi version of 3.9.
I have a template named Test.xltm in my database.On click of download button i want to convert the Test.xltm to Test.xlsm.
Default extension given is Test .xls and it is downloading without any issues.
But when i change the filename (Test.xlsm) in business logic, i am getting invalid file format or file corrupted while opening the file .
Below is my code :
String filename=Test.xls;
| ExternalContext econtext = facesContext.getExternalContext(); |
| HttpServletResponse response = (HttpServletResponse) econtext.getResponse(); |
| |
Sheet sheet;
| response.setContentType("application/force-download"); |
| response.setHeader("Content-Disposition", "attachment;filename=\"" + filename + "\""); BlobDomain template = (BlobDomain) ExcelRowvo.getAttribute("Template"); ----> getting .xltm template |
| InputStream is = template.getInputStream(); Workbook workbook = new XSSFWorkbook(OPCPackage.create(filename)); ----->creating .xlsm file sheet = workbook.getSheetAt(0); is.read(); please tell me how to write .xltm to .xlsm for downloading the file as Test.xlsm Thanks |
| |