private void setupRenderTask(IRenderTask rendTask, RptProperties properties) { String outputFormat = null; switch (properties.getOutputFormat()) { case HTML: outputFormat = "html"; break; case DOC: outputFormat = "doc"; break; case PDF: outputFormat = "pdf"; break; case PPT: outputFormat = "ppt"; break; case XLS: outputFormat = "xls"; break; default: outputFormat = "html"; } IRenderOption renderOption = new RenderOption(); renderOption.setOutputStream(new ByteArrayOutputStream(bufferSize)); renderOption.setOutputFormat(outputFormat); rendTask.setRenderOption(renderOption); rendTask.setLocale(properties.getLocale()); }