I have four columns (fields) in my csv data source, out of that I want to show only two
fields when the report is loaded.
How can I do that programatically ?
Thank you for posting your question!
When you create report object, you can specify
slice sub-object, defining which hierarchies are shown on the grid, filtration, sorting, etc. Please have a look at this JSFiddle: https://jsfiddle.net/17y8edL8/4/. Here
data.csv contains 9 columns and only 3 of them are shown on the grid. The most convenient way to configure slice is via Field List (arrow sign in the upper right corner). Then you can save the report by clicking Save button in Toolbar and use this report with the configured slice.
For more information about slice refer to our docs: Slice Object.
Please let me know if the above information was helpful.