OroCRM Forums

Covering OroCRM topics, including community updates and company announcements.

Forums Forums OroCRM OroCRM – How do I? Questions Add line with sum of each column in datagrid

This topic contains 4 replies, has 2 voices, and was last updated by  fred33 6 years, 10 months ago.

Starting from March 1, 2020 the forum has been switched to the read-only mode. Please head to StackOverflow for support.

  • Creator
    Topic
  • #29314

    fred33
    Participant

    Hi,
    all is in the title. I just want to add line, at the begining or at the end of the datagrid, who represent the sum of each column. this is the code of my datagrid

    Thanks for any idea

Viewing 4 replies - 1 through 4 (of 4 total)
  • Author
    Replies
  • #29315

    akhristiansen
    Participant

    Hello, @fred33!
    I think you could do this with 2 different ways.
    First way: . Just try to add

    ( …just add as many values to expression as you need)

    Second way: Add to columns:

    ( e.g. this is representing full path, like YourBundle/Resources/views/FolderName/total.html.twig )

    And in template you can do something like this ( …just add as many values to expression as you need)

    #29316

    fred33
    Participant

    OK @akhristiansen but in my datagrid v.total is sum for each line of Janvier, Fevrier….The total value of each line is already listed in my db.
    client Janvier Fevrier Mars……. Total
    Cli01 2 2 2 6
    cli02 1 2 1 4
    TotPerMonth 3 4 3 10

    The line totPerMonth is what i want to do

    Thanks

    #29317

    akhristiansen
    Participant

    In this case, I think you cannot do this by only datagrid`s native functionality. You could try second way ( with custom column twig template) and provide your own solution.

    #29318

    fred33
    Participant

    I think you’re right, i’m trying to do that

Viewing 4 replies - 1 through 4 (of 4 total)

The forum ‘OroCRM – How do I? Questions’ is closed to new topics and replies.

Back to top