1

I hope you are doing good and i really appreciate your help here for my query.

We have our system T3000 written in C++ (http://www.temcocontrols.com/ftp/software/9TstatSoftware.zip and codes are available here https://github.com/temcocontrols/T3000_Building_Automation_System).

I am trying to integrate 'BIRT reporting tool' in my C++ application. I want to create report based on the data available in our T3000 system. I think BIRT is embeddable (??). We don't need to compile and change the project, just need to be able to call it from T3000.exe mainly. My thinking is we may put one menu label in existing T3000 and try to display report in user single click.

Can you please help me to solve my issue with 'BIRT' ? I really appreciate your answer.

Regards Raju

Raju
  • 13
  • 5

2 Answers2

1

Well, the answer depends on what your definition of "embeddable" is.

BIRT is written in pure Java.

I could think of 3 different ways:

  1. Of course it is possible to integrate Java code into an existing C/C++ program (see Embed Java into a C++ application?).

  2. You could just use the BIRT runtime engine and generate the report as PDF or HTML from the command line (that means, basically you call the java executable from your program with several arguments). See Birt - How to run report engine on the console? and http://eclipser-blog.blogspot.de/2008/02/automatic-generation-of-birt-reports.html for more information.

  3. You could run a Java web server like Tomcat in a second process and then start your report by calling a http URL (e.g. you could use the included Servlet example). See http://www.eclipse.org/birt/documentation/integrating/viewer-usage.php

  4. Similar to 3. (see below)

Some notes:

The second option is slow, due to the Java and BIRT engine startup overhead (this may take several seconds). With the first and third option, the startup overhead is or can be minimized to only once (and for each report).

For the second and third option it may be necessary to modify the existing code of the example programs to suit your needs.

The first option is probably the best for an industry-quality solution, but it is also the most difficult to develop.

Anyway, Java skills are necessary IMHO.

If you plan to run this on a SOC instead of a PC, take performance into account. Is a Java-based solution well-suited for this kind of hardware? BIRT needs quite a lot of RAM and CPU (for a SOC). Hardware like the Raspi 3 should handle this quite easily, I reckon.

I integrated the BIRT runtime into an existing Python application (all this running on an application server) in a fourth way: I wrote a listener program that listens on a TCP socket for BIRT tasks. It uses a pool of worker processes (written in Java) which in turn use the BIRT report engine to generate the output. The client program (here: written in Python) opens a TCP connection to the listener and uses this socket to tell it which report to generate (including report parameters and destination file name). The listener program then in turn chooses a worker process for the task and gives the task to the worker process.

So, basically, this fourth option is similar to the third one, with two differences:

  • The communication is socket-based (instead of http), allowing bi-di communication.

  • The architecture is multi-processes instead of multi-threading. We choose this because very large reports could cause out-of-memory errors for otherwise unrelated reports that just happen to run at the same time. It's the same basic architecture Oracle chose for their reports server.

However, developing the programs took months.

Community
  • 1
  • 1
hvb
  • 2,484
  • 1
  • 10
  • 13
0

HVB: I have to give you more than a simple thanks for the explanation above, this info will save us time I am sure. Raju will be sharing our experience after we get into the project a little deeper so others can benefit.