Get Free Trial

Set the sequence of columns

Anjali Changale asked on November 10, 2020

I want to define the sequence of columns in report grid.
example- Suppose there are 3 columns- A,B and C
A and C are the simple text rows(not measures) and B is calculation (comes under measures)
slice: {
  rows: [
         { uniqueName: “A”, caption: “A”},
         { uniqueName: “C”, caption: “C” },                                                         
   columns: [{ uniqueName: “[Measures]” }],
   measures: [                              
      { uniqueName: “B”, aggregation: “sum”, format: “currency” , caption:”B”}
Here , the sequence will be -> A,C,B
How can i get it as -> A,B,C

2 answers

Illia Yatsyshyn Illia Yatsyshyn Flexmonster November 10, 2020

Thank you for posting on our forum.
If we understand you correctly, the flat form is used in your case.
To define the order of fields on the flat table, use the flatOrder property of the Slice Object.
It should be specified like this: ["A", "B", "C"].
You are welcome to see the JSFiddle we have prepared for the demonstration.
Please let us know if it works for you.
Feel free to contact us in case any further questions arise.
Best regards,

Anjali Changale November 12, 2020

It is working. Thank you!!!

This question is now closed