
Quote from roccocogliano on April 13, 2022, 4:47 pmHi,
I'm using the plugin (neoQR) for generating QR codes.
I have a table (neotable) with some data ([JsonAcquisitori4QR]) inside and then when I click on a row I see details of that row and I generate a QR code with some data and I show it in a container.
Then I can retrieve the image of the QR code in base64 thanks to ImgToBase64Png, indicating the container and 'img'. So far everything ok.
Then I written a procedure that scrolls the source json object (that of the table) with a loop to generate all the QR codes of all the rows (to be able to insert them in a pdf) in this way:neoTableGetAllData "Container_Acquisitori" [JsonAcquisitori4QR]
LoopObject [count4QR] [JsonAcquisitori4QR]
setvar [produttoreAcquisitori4QR] [JsonAcquisitori4QR([count4QR]).Produttore]
setvar [modelloAcquisitori4QR] [JsonAcquisitori4QR([count4QR]).Modello]
setvar [serialeAcquisitori4QR] [JsonAcquisitori4QR([count4QR]).Seriale]
setvar [afferenzaAcquisitori4QR] [JsonAcquisitori4QR([count4QR]).Sede_Afferenza]...CREAZIONE QR CODE per ogni dispositivo in lista
setvar [QRCodeText_Hidden] "dbs|2|Acquisitore|[produttoreAcquisitori4QR]|[modelloAcquisitori4QR]|[serialeAcquisitori4QR]|[afferenzaAcquisitori4QR]"
neoQR "Container_QRAcquisitore" "[QRCodeText_Hidden]" "" ""...Recupero immagine del QR code
ImgToBase64Png "Container_QRAcquisitore img" [base64DataQR_Acquisitore_hidden]
..jsalert [base64DataQR_Acquisitore_hidden]
Consolelog [base64DataQR_Acquisitore_hidden]EndLoop
but sadly what works in a single step doesn't work in the loop. Ie ImgToBase64Png "Container_QRAcquisitore img" [base64DataQR_Acquisitore_hidden] returns 'data :,' in Console
I hope I was clear.Suggestions?
What's wrong with the loop?
Greetings
Rocco
Hi,
I'm using the plugin (neoQR) for generating QR codes.
I have a table (neotable) with some data ([JsonAcquisitori4QR]) inside and then when I click on a row I see details of that row and I generate a QR code with some data and I show it in a container.
Then I can retrieve the image of the QR code in base64 thanks to ImgToBase64Png, indicating the container and 'img'. So far everything ok.
Then I written a procedure that scrolls the source json object (that of the table) with a loop to generate all the QR codes of all the rows (to be able to insert them in a pdf) in this way:
neoTableGetAllData "Container_Acquisitori" [JsonAcquisitori4QR]
LoopObject [count4QR] [JsonAcquisitori4QR]
setvar [produttoreAcquisitori4QR] [JsonAcquisitori4QR([count4QR]).Produttore]
setvar [modelloAcquisitori4QR] [JsonAcquisitori4QR([count4QR]).Modello]
setvar [serialeAcquisitori4QR] [JsonAcquisitori4QR([count4QR]).Seriale]
setvar [afferenzaAcquisitori4QR] [JsonAcquisitori4QR([count4QR]).Sede_Afferenza]
...CREAZIONE QR CODE per ogni dispositivo in lista
setvar [QRCodeText_Hidden] "dbs|2|Acquisitore|[produttoreAcquisitori4QR]|[modelloAcquisitori4QR]|[serialeAcquisitori4QR]|[afferenzaAcquisitori4QR]"
neoQR "Container_QRAcquisitore" "[QRCodeText_Hidden]" "" ""
...Recupero immagine del QR code
ImgToBase64Png "Container_QRAcquisitore img" [base64DataQR_Acquisitore_hidden]
..jsalert [base64DataQR_Acquisitore_hidden]
Consolelog [base64DataQR_Acquisitore_hidden]
EndLoop
but sadly what works in a single step doesn't work in the loop. Ie ImgToBase64Png "Container_QRAcquisitore img" [base64DataQR_Acquisitore_hidden] returns 'data :,' in Console
I hope I was clear.
Suggestions?
What's wrong with the loop?
Greetings
Rocco

Quote from luishp on April 13, 2022, 5:13 pm@roccocogliano probably the loop is looping too quickly so there is no time to generate the QR code and get the Base64 encoded image from one loop to the next one. Try using a Timer object or a SetInterval Command to loop through the JSON object.
Regards.
@roccocogliano probably the loop is looping too quickly so there is no time to generate the QR code and get the Base64 encoded image from one loop to the next one. Try using a Timer object or a SetInterval Command to loop through the JSON object.
Regards.

Quote from roccocogliano on April 13, 2022, 5:44 pmyes, that's right, it's likely.
Thank you so much
yes, that's right, it's likely.
Thank you so much