I didn't delve into the Birt library to do it and didn't create any classes using their API like it shows in your link, so this may not be the most efficient solution.
This was some months ago and I don't have access to the source now but basically I just added the BirtRuntime to my webapp as a servlet as covered here.
This allowed me to load Birt reports, but I also needed to embed them in existing web pages. I already had a pretty simply proxy servlet in this app which would just read the html content of a url. So I just called this servlet using the url for my BIRT report and I would stick the output where I wanted it on the web page.
Proxy servlet was like this:
import java.io.IOException;
import java.io.InputStream;
import java.net.MalformedURLException;
import java.net.URL;
import javax.servlet.ServletException;
import javax.servlet.ServletOutputStream;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import org.apache.commons.io.IOUtils;
public class ProxyServlet extends HttpServlet {
public void doGet(HttpServletRequest request, HttpServletResponse response)
throws ServletException {
String urlString = request.getParameter("url");
try {
URL url = new URL(urlString);
url.openConnection();
InputStream in = url.openStream();
ServletOutputStream out = response.getOutputStream();
IOUtils.copy(in, out);
}
catch (MalformedURLException e) {
throw new ServletException(e);
}
catch (IOException e) {
throw new ServletException(e);
}
}
}