0

Problem Dynamic Print Layout - iteration

Hello,

I'm having problems with my dynamic report - Json - Word.

I have data iterations, but they don't want to repeat on the document.  I use {d.geo[i+1]} but they don't appear on the final result. If I use a table with columns, result is same.

I tested my loop to make sure that the JSON code was able to collect the data (I see datas with coma like separator)  and it works, but not in the final output.  The [i+1] doesn't work.

Does anyone know of a solution to this problem? I have an important report to render and would like to automate the process in Ninox.

Many thanks in advance. :-)

9 replies

null
    • Fred
    • 8 days ago
    • Reported - view

    If your doc that just has

    {d.geo[i].ID}

    {d.geo[i+1]}

    Does anything print?

    In your table Cadastre is there another reference field called Cadastre? I ask because your Ninox code has that structure.

    geo: for i in Cadastre order by ID do
    {
      ID: i.Cadastre.ID
    }
    

    Can you post a sample of your JSON for geo?

    If I have this in my Carbone code:

    {d.teams[i].teamName}

    Event 1:

    {d.teams[i].e1Pl}

    Event 2:

    {d.teams[i].e2Pl}

    Event 3:

    {d.teams[i].e3Pl}

    Event 4:

    {d.teams[i].e4Pl}

     

    {d.teams[i+1].teamName}

    It shows up like:

    so it should work.

      • gaetan
      • 8 days ago
      • Reported - view

       

      Dear Fred, 

      Thank you for your time and the response.

      Cadastre is a variable for a select(Biens.parcelles) . I receive datas, I have 2 lines (show picture), I make a test and I receive the 2 lines of datas.

      But no iterate in my word document.

      I make a test and change Cadastre, its no working too. Without iterate, I show datas

    • gaetan
    • 8 days ago
    • Reported - view
        geo: for i in Cadastre do
            {
                ID:i.Cadastre.ID
                commune: i.Cadastre.'Commune cadastrale',
                section: i.Cadastre.'Section cadastrale',
                numero: i.Cadastre.'N° Cadastral',
                contAre: i.Cadastre.Ares,
                contCenti: i.Cadastre.Centiares,
                type: i.Cadastre.NomTypeCadastre
            }
        end,
    
    jSON code
    
      • Fred
      • 8 days ago
      • Reported - view

      That is the Ninox code to make the JSON. Put this code in a formula field in the same table as the dynamic print and copy a bit of the actual JSON code that is produce.

      • gaetan
      • 7 days ago
      • Reported - view

       

      I show this result in formula field.  They duplicate all informations? I Don't understand 

      [{"ID":["MC21","MC22"],"commune":["HESPERANGE","LUXEMBOURG"],"section":["A DE HESPERANGE","A DE LIMPERTSBERG"],"numero":["215/6241","1045/5988"],"contAre":[3,17],"contCenti":[9,0],"type":["Bâtiment à habitation","Bâtiment à habitation"]},{"ID":["MC21","MC22"],"commune":["HESPERANGE","LUXEMBOURG"],"section":["A DE HESPERANGE","A DE LIMPERTSBERG"],"numero":["215/6241","1045/5988"],"contAre":[3,17],"contCenti":[9,0],"type":["Bâtiment à habitation","Bâtiment à habitation"]}]
      
    • Fred
    • 7 days ago
    • Reported - view

    Can you post a sample DB?

      • gaetan
      • 7 days ago
      • Reported - view

       I modify the loop 

      geo: for i in Cadastre do
              {
                  ID:i.Cadastre.ID
                  commune: i.'Commune cadastrale',
                  section: i.'Section cadastrale',
                  numero: i.'N° Cadastral',
                  contAre: i.Ares,
                  contCenti: i.Centiares,
                  type: i.NomTypeCadastre
              }
          end,
      
      
      I obtain no duplicate informations :
      
      [{"ID":"MC21","commune":"HESPERANGE","section":"A DE HESPERANGE","numero":"215/6241","contAre":3,"contCenti":9,"type":"Bâtiment à habitation"},{"ID":"MC22","commune":"LUXEMBOURG","section":"A DE LIMPERTSBERG","numero":"1045/5988","contAre":17,"contCenti":0,"type":"Bâtiment à habitation"}]
      
      • Fred
      • 7 days ago
      • Reported - view

      if everything is working, please mark this post "Answered".

    • gaetan
    • 6 days ago
    • Reported - view

    Hello Fred,

    Thanks for taking the time to follow up on this post.
    I found the solution. I had a problem with a loop higher up in my document. 
    I tested the iteration on a blank document and it works. I went back to my document and removed each part to test them. I found the solution: a higher loop with my customers was endless. 

    Thanks for your help 

Content aside

  • Status Answered
  • 6 days agoLast active
  • 9Replies
  • 67Views
  • 2 Following