It is possible to make totals divided by group xlsx?



  • Hello everyone,

    It might not be easy to understand with the title what I am asking so I am going to try to explain as well as I can here.

    Lets say I have some data(name | deparment | cost):

    Jhon | 01 | 10
    Mike | 01 | 5
    Stan | 02 | 2
    Alice | 02 | 1
    

    What I would like to do is this:

    Jhon 01 10
    Mike 01 5
    
    * Totals 01 15
    Stan 02 2
    Alice 02 1
    
    * Totals 02 3
    
    * Totals   18
    

    I want to have subtotals for each deparment and also the totals for the whole data. All this I want ot do is XLSX and the data would be dynamic, I will not know how much data I am adding to the file.

    Is this possible to do directly with jsreport or should I first, somehow, prepare the data and give everything "done" to jsreport?

    Thank you.


  • administrators

    hi @Haritz-Lopez I think this is not possible at the moment in an easy way, of course, you can always use the xlsx transformation and that should allow you to do anything you want, but it is going to be more complex of course and also it will require you to spend time understanding the changes you need to make in the internal xml files of the xlsx.

    i am working right now on having support for multi-rows each support, when that is implemented it should be possible to achieve this. basically, you will make an iteration that involves multiple rows, and those rows are going to be repeated based on that data.

    Is this possible to do directly with jsreport or should I first, somehow, prepare the data and give everything "done" to jsreport?

    you can also prepare the data inside the jsreport with a script or helpers, so you can transform it and group it based on your needs, but as described above you are going to need to have the muti-rows each to be supported in order to have this working easily for you, i am working on it.


Log in to reply
 

Looks like your connection to jsreport forum was lost, please wait while we try to reconnect.