Converting Oracle Reports (.rdf) to BIRT reports
Asked Answered
J

3

6

I have some Oracle Reports (.rdf) that I am considering converting to BIRT reports. Is there a way to convert .rdf files to BIRT report design files?

Jalisajalisco answered 14/1, 2011 at 20:13 Comment(1)
Did any of these answers help, @shikarishambu?Foumart
F
5

A fully automated solution is probably not possible. You can partially automate the conversion process as follows:

  1. Convert the RDF files to XML.
  2. Extract the report query.
  3. Convert the XML to BIRT (or JRXML) using XSLT.

XML Conversion

The first step is fairly simple, using Cygwin:

cd /path/to/reports/
mkdir xml
for i in *.rdf; do
  rwconverter.exe batch=yes source="$i" dest=xml/"$i".xml dtype=xmlfile \
    userid=scott/tiger@xe
done

Extraction

The second step is also relatively easy, using starlet (rename xml.exe to starlet.exe to avoid conflicts with Oracle's xml.exe):

starlet.exe sel -t -v "/report/data/dataSource/select" filename.rdf.xml

You can also use xmllint, but it includes the select and CDATA elements, which you'd have to parse separately:

xmllint --xpath /report/data/dataSource/select filename.rdf.xml

Format Conversion

The third step is challenging. Create an XSL template that reads the RDF layouts (e.g., <displayInfo x="0.74377" y="0.97913" width="1.29626" height="1.62695" />). Then convert those layouts to the corresponding format used by the destination report engine (such as BIRT or JasperReports).

You wouldn't get a 100% solution, but an 80% solution could significantly reduce the amount of monotonous, error-prone work required to convert the reports.

Foumart answered 24/1, 2013 at 18:7 Comment(0)
C
3

I once had a job to convert *.rdf files to Jasper reports. Since I don't know BIRT, I have no idea if this approach would work with BIRT, too.

Anyway, I exported the *.rdf files as xml and parsed the output with Perl and wrote the Jasper definitions, also as xml. For most reports, this worked pretty well. I have -however- one report in mind that I couldn't translate automatically: that was a report where the result set of two queries were laid out side by side.

Childe answered 11/2, 2011 at 11:53 Comment(1)
@Rene: Can you teel me how to write the jasper definition to xml,as i am trying to convert rdf to jrxml,So the approach which i was selecting was to convert rdf to xml and then xml to Jrxml,if you are having any approach then could you please help me with it because mine approach looks little tedious.Strohbehn
M
1

I haven't found any tools which do this. Some might call this a business opportunity.

RDF files, as far as I can tell, are in some funky binary format. To even have a shot at this, I'd probably convert it first into a REX file, which is supposed to be portable xml. Then, it is a matter of transforming from the REX structure to the BIRT structure. Honestly, I have no idea how documented the REX file is, but maybe since you know how it looks from the visual side you can make sense of it.

Good luck!

Mudslinging answered 25/1, 2011 at 20:11 Comment(1)
I saw that article, but didn't know if the XML Publisher output is useful for BIRT.Mudslinging

© 2022 - 2024 — McMap. All rights reserved.