Where should you place XML files for an XML Data Source to a Birt report?
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: file:///c:/path1/path2/somefile.xml or file://path1/path2/somefile.xml 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
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. |
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"> <structure> <property name="fileName">shared/shared.rptlibrary</property> <property name="namespace">shared</property> </structure> </list-property> My XML report has this: <data-sources> <oda-data-source extensionID="org.eclipse.datatools.enablement.oda.xml" name="Data Source" id="7"> <property name="FILELIST">file:somefile.xml</property> </oda-data-source> </data-sources> But it's hard to know what are the relevant differences. Comments
Erik Mats
commented Apr 14 '16, 7:26 a.m.
fileName doesn't work as a property to the oda-data-source.
Erik Mats
commented Apr 14 '16, 7:42 a.m.
oda-data-source has no FILELIST property funny enough. http://www.eclipse.org/birt/ref/rom/elements/OdaDataSource.html
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
Dashboards and work items are no longer publicly available, so some links may be invalid. We now provide similar information through other means. Learn more here.