A Diumenge, 18 de desembre de 2011 00:05:25, Cédric Krier va escriure: > > I don't think I explained correctly. I want users to be able to create > > and upload their own reports. They can do that by creating a new > > ir.action.report record, but there's nothing in that record that > > indicates what "execute" function it should use so there's no smart way > > I can implement that. > > Could you describe exactly how it will work? > Because I thought that such reports were created in JasperReport.
Ok. Some background information: JasperReports [1] is a java library which interprets report files in the .jrxml extension/format, compiles them to the .jasper extension/format and can render them into PDF, ODT, XLS and other output formats, although PDF is clearly the best output. There's a .jrxml WYSIWYG editor called iReport [2] which end users can use to design their reports, picking the fields from several sources, such as SQL, Hibernate, OLAP, XML or (in latest versions) JSON, among others. What we allow in OpenERP is that users create their own reports using iReport with an HTTP XML datasource where information is provided by the OpenERP server directly which allows users to browse through the fields available in the ERP and add them in the report. Once the report is ready they upload it to the OpenERP creating a new ir.action.report. In this case we automatically create a new Report Keyword in the appropriate model so they have the report avilable. The way the module works is that it picks the .jrxml report the user has created, parses it to extract some information, creates all the data files needed in CSV format and passes the .jrxml and CSV files to a java application which is encharge of compiling the report and rendering it using the provided CSV files. Once the document (usually PDF) is ready, the module returns the PDF to the caller. > > I need a mechanism by which the JasperReports engine will be called > > instead of the default relatorio one, and that's why I think I need > > trytond to be prepared for that. > > I think your issue could be solved with a generic wizard. And the user > will just have to create a ir.action.wizard with the corresponding > keywords. Well, using the ir.action.report is has the advantage (I think) that you can override existing relatorio reports with your favorite jasper design. Think also about possible automatisms such as sending e-mails, or things like that. I think you want a uniform way of creating reports, no matter what engine is used. > I think we should really think about the benefit of having multiple > report engine (in the Tryton meaning). Because I'm affraid that we will > split the effort through multiple small projects instead of having it on > one (not necessary relatorio if it doesn't fit anymore). > This doesn't mean it is not possible to use something else but if we > have such options, it is opening the doors for such behavior. > Seeing what is happening to OE with their 5 standards + many externals, > it is something that I won't want to see for Tryton. I mean having each > one creating his standard sets of reports for his report engine of > choice. I understand your worries and I agree. At the same time, I think there are clearly two different needs that are managed by two kinds of applications: one is document creation (that is LibreOffice Writer, Microsoft Word, etc) and the other one is report creation (that is JasperReports, CrystalReports, etc). I think these are two kinds of needs actually with a different set of pros and cons and I think they must be provided by different engines. I've created applications in the past supporting both (it was Word and Crystal reports at that time) and also have seen proprietary ERPs doing the same too. Regarding OpenERP it is true that there have emerged several kinds of engines and don't actually know how to avoid that. I think that several of such options (3?) already come from relatorio and the need came because OpenERP didn't provide a WYSIWYG editor. Core provides RML but I think it simply is not an option because it has its own schema and doesn't have a WYSIWYG editor. Lately there's been webkit which I've got the impression that they created it for performance reasons. [1] http://jasperforge.org/projects/jasperreports [2] http://jasperforge.org/projects/ireport -- Albert Cervera i Areny http://www.NaN-tic.com Tel: +34 93 553 18 03 http://twitter.com/albertnan http://www.nan-tic.com/blog -- tryton-dev@googlegroups.com mailing list