It's all about the answers!

Ask a question

Where should you place XML files for an XML Data Source to a Birt report?

Erik Mats (105725) | asked Apr 13 '16, 3:45 p.m.
In a Birt report you can specify an XML data source. You then specify a URL for an XML file containing report data.

This mechanism requires that the report generator running on the CLM server can read the XML file at the time you run the report.

The question then becomes: What do you feed for a URL to the XML data source.

If you can place the file on the server you can specify:

If you are not able to access the file system directly, you can place it on another server which the report generator can reach anonymously, such as an FTP server or Sharepoint. Tomcat and WAS Liberty Profile can also be used to publish files. The URL then becomes http://yourserver/somefile.xml or ftp://yourserver/somefile.xml

However, I wonder if the "Files" option for a report resource can be used to upload an XML file for a report to the CLM server. The upload widget says: "Manage attached files used by this report resource. Select a local file to upload." But what URL format would my report use to reference these XML files? I have tried with file:somefile.xml, but no luck..

Are there other options where a user without admin access to the file system of the server, can upload an XML file?

2 answers

permanent link
Donald Nong (14.4k314) | answered Apr 13 '16, 11:56 p.m.
Hi Erik, if you want to use relative path for the XML data source file, it can be very problematic, particularly when we are stuck with BIRT 2.6.2. With BIRT 2.6.2, it appears to always expect an absolute path when file:// is used. If you try to use the current path (.) or upper path (..), it will complain. It appears that latest version of BIRT allows relative path but it brings another problem - what is the current path. With BIRT Designer, that current path appears to be the root of Eclipse workspace. With the Report Engine, I have no idea what it should be.

I believe it will be easier and more robust to just use HTTP or FTP protocol for the file source.

Erik Mats commented Apr 14 '16, 7:28 a.m.

Thank you Donald!

permanent link
Erik Mats (105725) | answered Apr 14 '16, 7:20 a.m.
Thank you Donald!

It occurred to me that we have some out-of-the-box reports that successfully use the "attachment" mechanism in Report resources, such as "Closed Work Items Daily".

This rptdesign contains this reference to an attached file, which reasonably must be resolved by the report generator (not the web browser):
    <list-property name="libraries">
            <property name="fileName">shared/shared.rptlibrary</property>
            <property name="namespace">shared</property>

My XML report has this:
        <oda-data-source extensionID="org.eclipse.datatools.enablement.oda.xml" name="Data Source" id="7">
            <property name="FILELIST">file:somefile.xml</property>

But it's hard to know what are the relevant differences.

Erik Mats commented Apr 14 '16, 7:26 a.m.

fileName doesn't work as a property to the oda-data-source.
namespace doesn't seem to make a difference.

Erik Mats commented Apr 14 '16, 7:42 a.m.

oda-data-source has no FILELIST property funny enough.

Donald Nong commented Apr 14 '16, 9:14 p.m.

I think the properties are related to the class/extension, and not a universal specification.

Your answer

Register or to post your answer.