I need add two more columns after "Tipo" named column.

Answered
Rodrigo Rodrigues asked on February 1, 2024

Good afternoon, I'm trying to create the "material" and "account type" columns, creating two more properties in the mapping and in the lines, but this ends up pasting the new columns above the "type" column.

 
How do I do this?
 
What I need is in the photo below.
 
Thank you for your time in reading my question!

Attachments:
final_result.png

6 answers

Public
Rodrigo Rodrigues February 1, 2024

I have this layout: 

Attachments:
my_app.png

Public
Solomiia Andrusiv Solomiia Andrusiv Flexmonster February 2, 2024

Hello, Rodrigo!
 
Thank you for reaching out to us.
 
Kindly note that for adding new data fields to your pivot component, you need to specify their uniqueName in report.slice.rows as follows:

report: {
dataSource: {/*connecting to your data source*/},
slice: {
rows: [{
          uniqueName: "Material"
        }, {
          uniqueName: "Tipo"
        }, {
          uniqueName: "Account type",
        },
      ],
//other slice properties
},
// other report properties
}

 
You can read more about configuring the slice in our docs: https://www.flexmonster.com/doc/slice/.
 
Hope you will find our answer helpful.
Feel free to reach out to us if you have any further questions.
 
Kind regards,
Solomiia

Public
Rodrigo Rodrigues February 5, 2024

Hello Solomiia, thanks for the response.
It does not work for me. See my output below.
I need this material to be after the Type column, without there being a mesearue.

class ReportConfig {
          constructor (store, instance) {
            const results = instance === 'provision' ? store.results.itemsProvision : store.results.itemsReversal;

            this.config = {
              dataSource: {
                data: results,
              },
                -- mapping: {
                --   "type": {
                --     uniqueName: "type",
                --     type: "string"
                --   }
                -- },
                slice: {
                  rows: [
                    {
                      uniqueName: "material",
                      caption: "Material",
                    },
                    {
                      uniqueName: "type",
                      caption: "Tipo",
                    }
                  ],
                  columns: [
                    {
                      "uniqueName": "[Measures]"
                    }
                  ],
                  measures: [
                    {
                      uniqueName: 'januaryWithIss',
                      caption: 'Janeiro com ISS',
                      format: 'RealFormat',
                    },
                    {
                      uniqueName: 'januaryWithoutIss',
                      caption: 'Janeiro sem ISS',
                      format: 'RealFormat',
                    },
                    // More Months
                  ],
                },
                "formats": [
                  {
                    "name": "RealFormat",
                    "thousandsSeparator": ".",
                    "decimalSeparator": ",",
                    "decimalPlaces": 2,
                    "currencySymbol": "",
                    "currencySymbolAlign": "left",
                    "nullValue": "",
                    "textAlign": "right",
                    "isPercent": false
                  },
                  {
                    "name": "PercentFormat",
                    "decimalPlaces": 2,
                    "currencySymbolAlign": "left",
                    "nullValue": "",
                    "textAlign": "right",
                    "isPercent": true
                  }
                ],
                options: {
                  showAggregationLabels: false
                },
            }
          }
        }

Start your code here

Attachments:
output.png

Public
Solomiia Andrusiv Solomiia Andrusiv Flexmonster February 6, 2024

Hello, Rodrigo!
 
Thank you for getting back to us.
 
If we understand correctly, you are looking for a way to show the totals row first (on top of the cell values) instead of having it in the end.
If so, please note that currently, the classic view displays the totals row below the cell values and the measures' names in the same line as the headers for fields "Tipo" and "Material," like in the example: https://jsfiddle.net/flexmonster/a27L0bx1/.
 
In case you do not need the data aggregated for each cell, we also provide the flat form of the grid with only one total row calculated and other values as-is from the data source. Using the flat view, you can show the totals row on top, for example: https://jsfiddle.net/flexmonster/3z5gfyo7/.
 
Hope you will find our answer helpful. Please provide us with more details in case you need our further assistance.
 
Kind regards,
Solomiia

Public
Rodrigo Rodrigues February 7, 2024

Hello Solomiia,
Thank you, the flat layout works perfectly for me situation.
Grateful for quick answers.

Public
Solomiia Andrusiv Solomiia Andrusiv Flexmonster February 7, 2024

Hello, Rodrigo!

Thank you for your feedback.

We are glad to hear that the flat layout works well for you.

Feel free to contact us in case of any other questions.

Kind regards,
Solomiia

Please login or Register to Submit Answer