Hi,
Inow have a bit more information about what is causing the error on my end. Hopefully someone can point in the right direction about how to write the generated workbook to a stream.
My code falls apart on the following line: a.write(bos).
This gives the error java.lang.IllegalStateException: Cannot use PrintWriter while ServletOutputStream is in use
CODE in postGenerationProcess:
FacesContext context = FacesContext.getCurrentInstance();
Session session = (Session) context.getApplication().getVariableResolver().resolveVariable(context, “session”);
Stream stream = session.createStream();
ByteArrayOutputStream bos = new ByteArrayOutputStream();
//CAUSES CRASH
a.write(bos);
// Convert the output stream to an input stream
InputStream is = new ByteArrayInputStream(bos.toByteArray());
stream.setContents(is);
Thanks very much. Any assistance is greatly appreciated