Issues rendering key values



  • I am trying to have something like this:

    0_1698671134893_upload-d400d6a4-3a02-4b3f-b24d-48451f74f646

    But, when I am trying to show it, I am struggling with rendering the key values, only being able to show the total value:

    0_1698671300439_upload-75c7be29-670e-490f-a5d6-dce56bb3e1e7

    Here is my demo:

    https://playground.jsreport.net/w/anon/WTomFmrW

    I also wanted the order to be Date - Key Values - Total, but for some reason, it is showing Key Values - Date - Total

    Any help would be appreciated, thank you



  • I don't understand the question.
    Please try to minimize the demo to just the relevant part.



  • I apologize. I have tried to simplify the demo as much as I could:

    https://playground.jsreport.net/w/anon/voyc2B2P

    I left some comments there to try and explain better what I am trying to do, but, pretty much I have the "sample" array, which has three different entries.

    My struggle here, is rendering the "values" object, where I am trying to display the keys (10,15,20) as the column titles and, for each one of them, create a row showing their respective value (pe: "10": 47.5)

    10 | 15 | 20 | date | total
    47.5 | 71.25 | 32 | 23-10-2023 | 150.75

    I'm not sure that the way that I am trying to get this result on my Sample -> content.js is the best approach, but it was the only idea I was coming with

    Hope this made it clearer, thank you



  • You seem to have just some js coding issues...

    I rewrote your requirement into two simple helpers, see here
    https://playground.jsreport.net/w/anon/RDV8JGok



  • Thank you very much


Log in to reply
 

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