Hello everybody,
I am new to BIRT but I'd like to have BIRT as the report-engine in my application.
My post is a little big but that's the only way I can describe my "problems".
First I try to describe my environment and my approches. At the end I have problem
descriptions for them I couldn't find any answers on the net.
The data for the report comes from an XML file that is generated by the main application.
This data file serves as input for the report generator. The result of the report generator
is a HTML file based on the data within the XML file and a report design.
My system consists of 3 separate applications:
1.) The main application
2.) The report generator (BIRT console program, e.g. ReportGen.exe)
3.) The report designer (BIRT Standalone)
The layout of the system would be preferable as pictured as followed.
-> Location of the main application and the report generator application:

\Program Files\MainApplication\Reporting\Designs\*.rptdesign
\Data\alldata.xml
\Output\<result.html>
RepGen.exe (is located in the "Reporting"-main folder)
-> Location of the BIRT Designer:

\Program Files\BIRT-ReportDesigner
As a data source I have a XML file that's located in

\Program Files\MainApplication\Reporting\Data\data.xml.
It looks like:
<Root>
<Elements>
<Element Name="First element" ImageUrl=".\images\img_el01.jpg" />
<Element Name="Second element" ImageUrl=".\images\img_el02.jpg" />
</Elements>
</Root>
The report generator application is a simple console application that takes 3 program parameters:
1 - Path to the data.xml file (D:\Program Files\MainApplication\Reporting\Data\data.xml)
2 - Path to the report design file (D:\Program Files\MainApplication\Reporting\Designs\simple_report.rptdesign)
3 - Path and name of the outputfile (D:\Program Files\MainApplication\Reporting\Output\output_simple_report.html)
Process description:
- BIRT Report Designer
The report design is created independently of the actual XML data file, i.e. I create a report design today on basis
of a sample XML file that represents the correct structure of the actual data files. The report design is stored under the
"Designs"-subdirectory of the main application. E.g.:

\Program Files\MainApplication\Reporting\Designs\rep_example.rptdesign.
The report design (and the sample data file and schema file) are part of the product delivery of the main application.
(So the installation path of the main application and report generator may be unknown when a report is designed. This prohibits
the use of absolute file-/directory-paths.)
- Main application (Runtime)
In the main application I trigger the reporting functionality and select the report to be generated that bases on e.g. the rep_example.rptdesign.
The application collects all the information needed and create a valid data file according the xsd file. The data file is stored in the
"Data"-subdirectory of the main application. E.g.:

\Program Files\MainApplication\Reporting\Data\data_example.xml.
- Report generator
The report generator is called automatically by the main application when the generation of the data XMl was finished. The main application
calls the report generator and pass for the parameters the two files created above and an output file. E.g.:
ReportGen.exe .\Data\data_example.xml .\Designs\simple_report.rptdesign .\Output\result.html
Note: The paths in this example shall be exchangable, the goal is to have no static, absolute paths and filenames within the reportdesign.
Problem 1: Changing the data souce on runtime
Is it possible to separate the XML data source from the report design?
When I look into the .rptdesign (XML view) that is connected to a xml data source, this data source appears hardcoded within the XML file:
...
<data-sources>
<oda-data-source extensionID="org.eclipse.datatools.enablement.oda.xml" name="001 Example DS" id="7">
<property name="FILELIST">D:\Temp\001_Example.xml</property>
</oda-data-source>
</data-sources>
...
Is it possible to "replace" the data source "001_Example.xml" file and location during runtime? If so how can I do this?
The new XML file and the 001_Exxample.xml have both to be valid to the same XSD-file.
Problem 2: Dynamic image - Each element has its own graphic
As you can see in the title of this problem I want to display a graphic for each element on the report. The graphic itself is generated when
the data XML file is generated as JPG file. My approach would be to store these JPGs in a relative folder to the data-folder (so the value of
the XML-attribute "ImageUrl" could be specified as a relative path). E.g.:
<Reporting>\Data\Images\Img_el01.jpg
The renderer now iterates over the data XML and (e.g.) fill a table with 2 columns (name, graphic) on the report. The "name"-column will display
the name of the element as specified in the "Name"-XML-attribute (e.g.: "First element", "Second element", ...). Within the "Graphic"-column the
associated image shall be displayed (img_el01.jpg, img_el02.jpg, ...).
Here it would be the best when the imiages are referenced within the resulting HTML-file. E.g. I'd like to have the following HTML-output for the
two described example elements:
...
<table ...>
<tr...>
<th ..>Name</th>
<th ..>Graphic</th>
</tr>
<tr ...>
<td ..>First element</td>
<td ..><img src=".\images\img_el01.jpg" /></td>
</tr>
<tr ...>
<td ..>Second element</td>
<td ..><img src=".\images\img_el02.jpg" /></td>
</tr>
...
</table>
The images are copied into a "images"-subfolder relative to the output-folder to garantee the reachability of the image reference.
Unfortunately I couldn't find an example or other hints to support me in my deeds. That's why I turned to this forum with the hope to get an answer or
(even better) a proposal for solution for my problems.
Any help is welcome since I am pretty new to the BIRT-stuff.
Thanks in advance.
Regards,
Sebastian