Discussions
Categories
Groups
Community Home
Categories
INTERNAL ENABLEMENT
POPULAR
THRUST SERVICES & TOOLS
CLOUD EDITIONS
Quick Links
MY LINKS
HELPFUL TIPS
Back to website
Home
Intelligence (Analytics)
How to set the relative path for flat file datasource connection
srikala
I want to set a relative path when i use a flat file datasource connection. How can i do that in birt, i am using the birt version BIRT 7.2.1
Find more posts tagged with
Comments
MALPI
Hey,<br />
<br />
dont know if it works for you, but I think it could. I got a database Source. <br />
<br />
At first I have setup a profile File with Birt like you have done.<br />
<br />
Next i put following code in beforeOpen Script of the datasource:<br />
<br />
<pre class='_prettyXprint _lang-auto _linenums:0'>
var pathToHome = reportContext.getReportRunnable().getReportName();
pathToHome = BirtStr.left(pathToHome,BirtStr.indexOf("FOLDER OF YOUR DESIGN FILE", pathToHome));
setExtensionProperty("OdaConnProfileStorePath", pathToHome + "PLACE OF YOUR PROFILE");
</pre>
<br />
Hope this helps you.<br />
<br />
Greets,<br />
<br />
MALPI
Linda Chan
If you are using the latest BIRT 3.7.1 or later, the relative path feature is built in the Flat File data source, i.e. no need to use scripting.
In the Flat file data source wizard/editor dialog, select the "Relative path" button (from the Browse... menu next to the "Enter file URI" text control). Such path is defined as relative to the BIRT Resource folder, which is set to the current BIRT Project folder by default.
Linda
srikala
<blockquote class='ipsBlockquote' data-author="'Linda Chan'" data-cid="93959" data-time="1326318014" data-date="11 January 2012 - 02:40 PM"><p>
If you are using the latest BIRT 3.7.1 or later, the relative path feature is built in the Flat File data source, i.e. no need to use scripting.<br />
In the Flat file data source wizard/editor dialog, select the "Relative path" button (from the Browse... menu next to the "Enter file URI" text control). Such path is defined as relative to the BIRT Resource folder, which is set to the current BIRT Project folder by default.<br />
<br />
Linda<br /></p></blockquote>
<br />
<br />
HI Linda<br />
<br />
If you can see the attachement of my post, you can find the setting i am doing, but the browse is not allowing me to browse anything. <br />
Please help!
Linda Chan
I tried with BIRT 3.7.1 all-in-one report designer just now. (It was downloaded from
http://download.eclipse.org/birt/downloads/build.php?build=R-R1-3_7_1-201109131734
)
The Flat file data source wizard's Browse... menu button works fine for me; selecting the "Relative path" option opens a browser of my BIRT Resource folder, as expected.
Perhaps you want to try with a new installation of the BIRT 3.7.1 all-in-one report designer?
Linda
Sai Kushal R
<p>1. How to specify the relative path if we are using the BIRT run time (not the eclipse).</p>
<p> </p>
<p>2. Even if in the eclipse if you want to specify the relative path how do we do it ??</p>
<p> Because in the eclipse it allows to browse the relative path inside the project folder , what if we want to extend this relative path.</p>
<p> </p>
<p>Thank in advance .</p>