Community
Participate
Working Groups
There are obvious differences in the behaviour of IRunAndRenderTask and separate run and render tasks. Right now, separate run and render tasks provide the most flexibility out of the two options (for example <VIEWTIME-VALUE-OF>, onRender-scripts on the masterpage etc.). If one wants to use separate run and render tasks, there are currently two options: 1. Run the report to File/Folder archive and read it back in from there. 2. Provide a custom IDocArchiveWriter/IDocArchiveReader that saves the intermediate format in RAM, possibly swapping to disk if the amount of data gets too large. Option 1 is suboptimal, because it involves disk access when it may not be needed, decreasing performance. Option 2 requires a custom implementation, because there is no implementation bundled with BIRT. Suggestions: 1. Provide a IRunThenRenderTask that provides the same semantics and runtime behaviour as separate run and render tasks but without the need to set this up manually. This custom task could then also do some optimizations under the hood, similiar to IRunAndRenderTask. 2. FileArchiveWriter seems like it provides most of Option 2 already, but always wirtes to disk. It could be tweaked to allow for a treshold number of bytes to be written into a buffer before swapping to tempfiles on disk. That way, smaller reports will be blazing fast and bigger reports won't run out of memory. This could be used to implement suggestion 1 or allow the user to do it himself more easily.
Try ArchiveFile af = new ArchiveFile("name", "rwt"); af.setCacheSize(); "t" means transient. The name is a temporary file in case the file size is larger than cache size. Once it is closed, the file will be removed from temp disk.
Wow, thanks for the fast answer. This bugtracker is more like a chat. :) Thanks for the hint to ArchiveFile, seems like there already is a lot of the needed functionality. That makes implementing this a lot easier. Sadly, ArchiveFile does not implement IDocArchiveWriter and IDocArchiveReader, so it can't be used directly in (shortened): runTask.run(archiveFile); IReportDocument reportDocument = engine.openReportDocument("", archiveFile, options); IRenderTask renderTask = engine.createRenderTask(reportDocument); renderTask.render(); Well, thanks for pointing me in the general direction. If I find the time, I'll do something with it. I would still think that a separate provided IRunThenRenderTask would be awesome, but if there are no plans for this, I'm fine with that. Best regards, Thomas