Discussions
Categories
Groups
Community Home
Categories
INTERNAL ENABLEMENT
POPULAR
PUBLIC CLOUD
PRIVATE CLOUD
Quick Links
MY LINKS
HELPFUL TIPS
Back to website
Home
Intelligence (Analytics)
Relative path for TSV file..
nirmal792
Hello Friends,
I have problem in setting relative path for my TSV file..
i tried script in beforeOpen of datasource..
var rp = reportContext.getHttpServletRequest().getSession().getServletContext().getRealPath("/scratch");
this.setExtensionProperty("HOME", rp);
but its not working...
please help me in that..
Thanx in advance
Find more posts tagged with
Comments
Virgil Dodson
Hi Nirmal, there is an example at the link below that shows how to swap the TXT data source at runtime... you could use the same approach to define the path to the TSV file.<br />
<br />
<a class='bbc_url' href='
http://www.birt-exchange.org/devshare/designing-birt-reports/949-switch-text-datasource-at-runtime/#description'>Switch
Text DataSource at runtime - Designs & Code - BIRT Exchange</a>
nirmal792
hii..
Thanx for u r reply..
the example u hav given is about the swapping of CSV file..in my case,i want to change the path of my datasource..my CSV file is constant.
Plz help me in that.
Virgil Dodson
Hi Nirmal, yes that's true that this example swaps the file and you want to swap the location. The process is exactly the same and you can follow the same approach from the example.<br />
<br />
First, create a report parameter that will hold the path you want to pass in... Then open your Data Source, switch to the Property Binding tab, and then press the small 'function' button next to Home Folder. Here you can contruct the home folder location and can even use JavaScript logic and any values from parameters. If you have passed the entire path in as a parameter, then you can simply double-click your parameter which will include a reference to:<br />
<pre class='_prettyXprint _lang-auto _linenums:0'>
params["whichPath"].value
</pre>
Assuming you created a parameter called 'whichPath'