Downloading panel content to a pdf file

Hello All,

I have a couple of BIRT reports that should be downloaded into one pdf file, when the user clicks a certain button. Can anyone give me some pointer on how to do this?

HL

Suppose that your pdf file is dynamic resource. In that case you can create StreamResource and pass one to the Link object:

StreamResource resource = new StreamResource(new AttachmentContentStreamSource(attachmentContent), attachmentContent.getFileName()); Link link = new Link(attachmentContent.getFileName(), resource); link.setTargetName("_blank"); where AttachmentContentStreamSource can be looks like the following:

public class AttachmentContentStreamSource implements StreamResource.StreamSource {
        /**
     * 
     */
    private static final long serialVersionUID = 1L;
    private final AttachmentContent content;
    public AttachmentContentStreamSource(AttachmentContent content) {
        this.content = content;
    }

    @Override
    public InputStream getStream() {
        return new ByteArrayInputStream(content.getData());
    }
}