Home
Analytics
BIRT Python API
milan_nalim
<p>Hi,</p><p> </p><p>1. I am wondering if it is possible with BIRT to create a</p><p>report template from its GUI tool with some "empty" fields/placeholders</p><p>which would be later filled with the data during run-time from Python program.</p><p>Exactly, does BIRTs offers API for that purpose ?</p><p> </p><p>2. Does BIRT requires to be feed with data only statically (from some DB) after</p><p>data are completely produced, or one can feed it dynamically through BIRT API </p><p>so that one can see data showing in report before e.g. complete measurement</p><p>is made ?</p><p> </p><p>thanks!</p><p> </p><p>Best regards,</p><p>Milan</p>
Find more posts tagged with
Comments
Yaytay
<p>BIRT doesn't offer any native python APIs.</p><p>Out of the box it offers Java APIs and a limited web server that can run reports (with arguments and parameters).</p><p>You may be able to get around the lack of python APIs by using Jython, but how useful that is will depend on what you are trying to do - I've never tried interfacing to BIRT using Jython.</p><p> </p><p>To answer your specific questions:</p><p>1. You can parameters to BIRT that are provided when reports are run, but these are fixed in size - you wouldn't want to use parameters to pass in large or variable amounts of data (although you <em>could</em> do it by passing in a single parameter as a CSV of the data and then parsing within scripts in the report).</p><p> </p><p>2. BIRT can take data from a number of places, but it always pulls the data, you don't push data to BIRT.</p><p>It is possible to have BIRT generate a report a page at a time, but that is intended as a UI optimisation, not a way to have a report of unknown length (I think it still processes all the data up front and then does the rendering by page, so you can't change the data during the render).</p><p>If you report is simple enough the thing to do is to just run it multiple times until you have your complete data.</p><p>The way to get custom data into BIRT is via a scripted dataset, which can be written either in Javascript or in Java (or, presumably, in any other JVM language such as Jython, but I've never heard of anyone doing so) - with a Java scripted data set you can pick the data up from anywhere.</p><p> </p><p>If you do manage to get BIRT working with Python (or Jython) I'd encourage you to do a write-up so others can see how you did it.</p><p> </p><p>Jim</p>