A fully automatic solution is probably not possible. You can partially automate the conversion process as follows:
- Convert RDF files to XML.
- Retrieve the report request.
- Convert XML to BIRT (or JRXML) using XSLT.
XML Conversion
The first step is pretty 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 simple using starlet (rename xml.exe to starlet.exe to avoid conflicts with Oracle xml.exe ).
starlet.exe sel -t -v "/report/data/dataSource/select" filename.rdf.xml
You can also use xmllint, but it includes select and CDATA elements that you must parse separately:
xmllint --xpath /report/data/dataSource/select filename.rdf.xml
Format conversion
The third step is difficult. Create an XSL template that reads RDF layouts (for example, <displayInfo x="0.74377" y="0.97913" width="1.29626" height="1.62695" /> ). Then convert these layouts to the appropriate format used by the destination report engine (for example, BIRT or JasperReports).
You would not get a 100% solution, but an 80% solution could significantly reduce the amount of monotonous, error-prone work needed to convert reports.
Dave jarvis
source share