java - Can i generate a xlsx file with the Writer class? -
java - Can i generate a xlsx file with the Writer class? -
is there way generate xlsx file using writer
class in java?
the method utilize generate workbook converted byte array:
private byte[] generatexlsxbytes() { xssfworkbook workbook = new xssfworkbook(); bytearrayoutputstream baos = new bytearrayoutputstream(); workbook.write(baos); baos.close(); homecoming baos.tobytearray(); }
i seek write bytes author doing this:
writer author = ..get writer.. ioutils.write(generatexlsbytes(), writer);
but when seek open file in excel message saying markup of file not right extension(xlsx).
i work custom made framework won't allow me utilize fileoutputstream
write straight file. appreciate if tell me way utilize writer
.
@a4l give thanks explaining me.
writers not meant writing raw bytes.
i asked 1 of coworkers create alter in framework, utilize outputstream
java xssf
Comments
Post a Comment