[Gambas-user] Report generation
Benoit Minisini
gambas at ...1...
Fri Apr 13 23:27:09 CEST 2007
On vendredi 13 avril 2007, Steven Lobbezoo wrote:
> Hi,
>
> I'm getting into the phase, where i have to generate reports in my
> application. Of course, I could use gb.print, but... it's still a
> bit 'starting up' and it does not make graphics and so on. This, all can be
> done in gambas, I know, but maybe it's easyer to use a report generator (or
> even integrate that into gambas) like Jasper. It has a nice report design
> module (ireport), and works quite good.
> However, it's written in java (Ugghh) and the guy's on its forums refuse to
> make available a runtime app (for a non-java programmer) to use. I have to
> install apache, tomcat, ant etc. etc. Very complicated and totally -not-
> interesting. ;-)
> I just want to use a design interface like their i-report and then generate
> some files (xml ...) that can be red by a runtime program to produce a
> report (print, pdf, ....).
>
> Has any of you guys any experiance ? Anybody found a good 'module' ?
> Maybe some tested agatha ?
>
> Thanks for your opinions.
> Steven
>
While the gb.report component is not finished, you can play with OpenOffice.
It is heavy and funny :-)
1) Read these documents
* http://www.itworld.com/AppDev/1461/UIR000330xvfb/
* http://www.xml.com/pub/a/2006/01/11/from-microsoft-to-openoffice.html
2) Install Xvfb.
3) Install OpenOffice and the macros described in 1), in the second document.
4) Create your report templates with OpenOffice. Put some markups in your
document, for example {{MyField}}.
5) When you want to print a report, copy your template, unzip it, look for the
contents.xml file, replace your markups by the real data. Do not forget to
escape special characters with entities, this is an XML file. Zip back the
data.
6) Run Xvfb to a new display.
7) Launch OpenOffice by asking it to connect to the new display, to open your
report generated in 4), and to save a PDF by using the macro describe in the
second document in 1). You will use something like that in Gambas:
SHELL "/usr/bin/ooffice -display :1 -invisible
\"macro:///Standard.MyMacros.SaveAsPDF(" & sTmp &/ "office.template" & ")\"
>/dev/null 2>&1" WAIT
If I had time, I would make a component for that :-)
Regards,
--
Benoit Minisini
More information about the User
mailing list