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)
How to set the dataset dynamically
new member
Hi,
I have a scenario that I pass the csv file urlpath and name of that file(like other parameters like empName and empId) and based on that I need to create the Data Set and use the fields from that csv file.
Can you help solve this.
I realy appriciate your help.
Thank you
Find more posts tagged with
Comments
mwilliams
Do you know the names of the columns that will be in the file?
If so, you can look at how the "queryText" is in your XML Source for you report and change your queryText in the beforeOpen script of your report only with the new file information. Then, you'd have to build your table from scratch in the beforeFactory script with the correct bindings. If all the column names are the same, but just the file name is different, you'd just have to change the file name. You could already have the table made and since the bindings and dataSet name wouldn't change, you wouldn't have any issues.
new member
<blockquote class='ipsBlockquote' data-author="'mwilliams'" data-cid="75274" data-time="1301513491" data-date="30 March 2011 - 12:31 PM"><p>
Do you know the names of the columns that will be in the file?<br />
<br />
If so, you can look at how the "queryText" is in your XML Source for you report and change your queryText in the beforeOpen script of your report only with the new file information. Then, you'd have to build your table from scratch in the beforeFactory script with the correct bindings. If all the column names are the same, but just the file name is different, you'd just have to change the file name. You could already have the table made and since the bindings and dataSet name wouldn't change, you wouldn't have any issues.<br /></p></blockquote>
<br />
<br />
Hi Michele,<br />
<br />
Thank you so much for your responce.<br />
<br />
I am new to BIRT Can you give me an example that would be so helpfull for me.<br />
<br />
Thank you
mwilliams
This devShare post will show you how to change the path to the file:
http://www.birt-exchange.org/org/devshare/designing-birt-reports/951-dynamically-changing-the-pathhome-for-a-flat-file-datasource/
Your ability to change files will most likely depend on your knowing the columns that will be in the file. You'll need to know the column names to set up the dataSet and to create your table with the correct bindings.