[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [Newsgroup Home]
[news.eclipse.birt] Re: Returning report in non HttpServlet stream

Bingo, works like a charm. Thanks Jason.

Jason Weathersby wrote:
Tom,

Try a ByteArrayOutputStream

    ByteArrayOutputStream ostream = new ByteArrayOutputStream( );
    options.setOutputStream( ostream );

Jason

Tom Corcoran wrote:
I am using gsp/grails. I have been unable to figure out how to get a report to return in a function as a html stream.

The WebReport example at http://wiki.eclipse.org/Servlet_Example_(BIRT)_2.1 extends HttpServlet and uses HttpServletResponse for the output stream, which is not relevant for me.

I have ended up saving to a html file

        HTMLRenderOption options = new HTMLRenderOption();
        options.setOutputFileName(outputFile);
        options.setOutputFormat(HTMLRenderOption.OUTPUT_FORMAT_HTML);
        options.setEmbeddable(true);
        options.setImageDirectory("images");

and then reading this back into memory. How can i bypass this step? perhaps using ByteArrayInputStream?

Thanks, Tom.