Re: [gnome-db] Re: Report API



Rodrigo Moya wrote:

On Tue, 2004-04-13 at 11:44 -0400, Loren Bandiera wrote:
Hey Rodrigo,

Hi

[Forwarding your mail to the gnome-db-list]

I'm still working on my XSLT stuff for the libgda report API.  Right now
this is how I see things working:

1. Create a GdaReportDocument (gda_report_document_new)
2. Load the report result into memory (gda_report_result_new_to_memory)
3. Dynamically build XSL stylesheet
4. Apply the XSL stylesheet and generate output.fo from report results
5. Convert from XSL-FO (output.fo) into XHTML, RTF, PDF

yes, that's the basic idea.

I'm thinking for an API:

xmlDocPtr gda_report_result_apply_style (GdaReportResult *report)

This function would take the results and build an XSL stylesheet and then
apply it.  The resulting XML document would be returned as xmlDocPtr.

gda_report_result_transform (xmlDocPtr doc, gchar *uri, gchar *format)
it would pretty nice if this API had some progress reporting. That is,
GdaReportDocument could have signals that warn about progress, so that
apps can display status messages, for instance, while the conversion
process is being run.
Could have a file /tmp directory marking progress. Signals have cross plateform issues and if runs in a different process it makes things difficult.
This would take the XML document after the XSL has been applied and
transform it into <format> and save it as <uri>.

There are some problems however:

1) I don't have a valid report.  I've got GdaReportDocument before it's
been processed by gda_report_result_new_to_memory() but I don't have the
final results.

I noticed test #9 in libgda/report/testing/gda-report-test.c should create
one but it doesn't work for me.  That is to be expected.  The
valid-example.xml defines queries for the report, but I don't have that
database setup.

So far I'm been working with XSL by hand (as mentioned in my last message)
assuming the formats are not too different.  It would be helpful though to
get a complete GdaReportResult.  Do you have one?

no, don't have one, this has to be filled up on the fly, from the DB,
isn't it?

2) Converting from the XSL-FO into XHTML, PDF, RTF, etc. requires a FO
processor.  I haven't been able to confirm libxslt supports this.

I know there is FOP from Apache (http://xml.apache.org/fop/index.html) but
that is Java based.

There is xmlroff from Sun (http://xmlroff.sourceforge.net/).  That is C
based and under a BSD license.


Thoughts? Comments?

I guess Andru would have things to say, since he is working on papyrus,
which offers similar stuff. I guess the best way to integrate
libgda-report and papyrus would be to offer the report API in libgda and
have papyrus be a frontend for it. Andru, what do you think?


I havn't looked at xsl-fo before or know whats its capiable of or how it works in detail. Should papyrus be continued to be run as a seperate process or should api be changed
and implimented into gnome-db library?  What does the xsl style sheet do for
the reports? Does when you dymically build the xsl resolve the database queries?

Do you need to construct reports in memory? (at moment input is only a file but parser could be modified to take xml doc instead in memory instead).






[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]