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)
Access files from local system as datasource
shivkumar150
<p>Hi BIRT Experts,</p>
<p> </p>
<p>I have an application which creates timestamped .csv files in a folder on the server machine file system (Ex: E:\Apps\BIRT\Sources\schedule). I want to use these csv files as datasource. Is it possible for BIRT to access these .csv files(on file system), provided that the .csv files are passed through report parameters. I have tried passing the csv files available in the BIRT webapp, and it is working fine. But how can I configure the datasource to search the csv file on local filesystem, instead in the webapp.</p>
<p> </p>
<p>With regards,</p>
<p>Shivkumar Birnale</p>
<p>BIRT Viewer version: 4.5.0</p>
<p>BIRT Engine version: 4.5.0</p>
<p>Java : 1.7u80</p>
Find more posts tagged with
Comments
shivkumar150
<p>Hi All,</p>
<p>Found the solution as below:</p>
<p>Yes, local files can be accessed by reports on Server.</p>
<p>In the <strong>beforeOpen</strong> method of the dataset, put the following script:</p>
<pre class="_prettyXprint">
this.queryText="select \"Object\",\"Address\" from "+params["file"].value+" :{\"User\",\"User\",STRING;\"Address\",\"Address\",STRING}";</pre>
<p>Create a report parameter named "<strong>file</strong>" and pass the csv file in the URL like <em>/birt/frameset?__report=UserAdd.rptdesign&file=addr1.csv</em></p>