It would be great, if some one can share the code to loop through the dataset in the before factory method
What product are you using? Is this for Document Sciences xPression?
Analytics Designer
You didn't mention what you are trying to do, but for most functionality iterating through the data set is not the best solution. Could you please describe what you want to achieve? Modifying the query or adding a computed column can often accomplish the same functionality more efficiently than iterating through the data set.
Need to change the column name in the dataset based on user selection. So need to get the column values in beforefactory and update the query in the data set scripts
If the user is entering the column names in report parameters, you can get the values entered in the parameters in the beforeOpen event handler of the data set using: params["your_param_name"].value
The query can be accessed and modified via: this.queryText.
The change to the query will take effect before the data is retrieved. You shouldn't need code in beforeFactory of the report unless I am misinterpreting what you are trying to do.
Thanks! But the solution will not work. Really need ways to iterate dataset in before factory and get the values
Based on the roles we need to find the corresponding column names and use it in the script
Using DEAPI to query a data set in the beforeFactory method is not the most ideal solution if another already exists, especially if you are using it to modify another data set, which would require dynamically building your table bindings using even more DEAPI to accommodate the changes you made to the data set its bound to.
Are you trying to dynamically add/subtract data set columns based on the user running the report?
Or change a data set column names based on the user running the report?
Or will the number of columns (along with their column names) stay the same between users, but contain different data based on the user running the report?
What is your end goal per using this method?
Or can you provide an example (with sample data) to demonstrate the final result you are wanting to accomplish?