Discussions
Categories
Groups
Community Home
Categories
INTERNAL ENABLEMENT
POPULAR
PUBLIC CLOUD
PRIVATE CLOUD
Quick Links
MY LINKS
HELPFUL TIPS
Back to website
Home
Intelligence (Analytics)
DEAPI: rptdocument file to OutputStream
spulci
Hallo,<br />
<br />
I need to obtain an rptdocument file in an OutputStream. It's clear how to reach the same result using IRenderTask or IRunAndRenderTask interface (using HTMLRenderOption for outputs in HTML or other classes for PDF or XLS output). It's not so clear to do the same with an IRunTask.<br />
<br />
In the api i found that the run method accept a FileArchiveWriter as input to store a document inside. I do not have images or other resourcers...my document is just a crosstable or a simple table with data istantiated from a fetched dataset.<br />
<br />
Should the code below the right task to reach this goal?<br />
<br />
<pre class='_prettyXprint _lang-auto _linenums:0'>
IRunTask task = reportEngine.createRunTask(design);
FileArchiveWriter fAW = new FileArchiveWriter(reportDesignFileName+".rptdocument");
task.run(fAW);
RAOutputStream raoStream = fAW.getOutputStream(reportDesignFileName+".rptdocument");
</pre>
<br />
Thanks a lot<br />
<br />
Simon
Find more posts tagged with
Comments
JasonW
Simon,
Why do you need the rptdocument in an output stream?
Jason
jkamaraj
One need to is to store the document in a database.
JasonW
The render task requires that an IReportDocument be passed to it. The engine when opening the rptdocument looks for a file location for the report document currently. One option is to use the open option that needs a IDocArchiveReader.
public IReportDocument openReportDocument( String systemId,
IDocArchiveReader reader, Map options ) throws EngineException
{
return engine.openReportDocument( systemId, reader, options );
}
The write your own implementation of the IDocArchiveReader. BIRT has essentially two types already implemented FileArchiveReader and FolderArchiveReader. Check these classes out of source for an idea of what they do. The idea would to modify one to read a blob type or export the blob to a temp location.
Jason