Relative path and flat file [message #96523] |
Mon, 05 December 2005 09:56  |
Eclipse User |
|
|
|
Hi all,
I'd like to say if is possible to have relative path in setting flat
file data source. In other words, I'd like that report read file in its
current directory because I must use report in my application and I
don't know where the program is installed.
Thanks for any help,
Pietro
|
|
|
Re: Relative path and flat file [message #98414 is a reply to message #96523] |
Mon, 12 December 2005 08:44  |
Eclipse User |
|
|
|
Originally posted by: gilles.vandaele.advalvas.be
Hi Pietro,
I did something who works fine: I set the dataSource.HOME and the
dataSet.queryText in the beforeOpen() methods of those two objects. I need
to set the default properties to valid paths, for the report to be loaded
fine in the designer, but at runtime, the datasource and dataset are
linked to a dynamic path (see my 'date' paramater).
The xml in the .rptdesign source becomes:
------------------------
<parameters>
<scalar-parameter name="date" id="17">
...
</scalar-parameter>
</parameters>
<data-sources>
<oda-data-source
extensionID="org.eclipse.birt.report.data.oda.flatfile" name="DataSource"
id="4">
<method
name="beforeOpen"><![CDATA[this.extensionProperties.HOME="P:\\daily\\ "+report.params["date"];]]></method>
<property name="HOME">P:\daily\20051111</property>
<property name="CHARSET">UTF-8</property>
<property name="INCLTYPELINE">NO</property>
</oda-data-source>
</data-sources>
<data-sets>
<oda-data-set
extensionID="org.eclipse.birt.report.data.oda.flatfile.dataSet "
name="DataSet" id="5">
<property name="dataSource">DataSource</property>
<method name="beforeOpen"><![CDATA[this.queryText="select *
from percentiles-"+report.params["date"]+".csv";]]></method >
-------------------------
Hope it helps.
|
|
|
Powered by
FUDForum. Page generated in 0.03435 seconds