Get Free Trial

Set the sequence of columns

Closed
Anjali Changale asked on November 10, 2020

Hi,
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

Public
Illia Yatsyshyn Illia Yatsyshyn Flexmonster November 10, 2020

Hello,
 
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,
Illia

Public
Anjali Changale November 12, 2020

It is working. Thank you!!!

This question is now closed