PC SOFT

FOROS PROFESIONALES
WINDEVWEBDEV y WINDEV Mobile

Inicio → WINDEV 2024 → [WD20] Is it possible to ControlCreate() in a Report?
[WD20] Is it possible to ControlCreate() in a Report?
Iniciado por guest, 10,jul. 2015 18:05 - 3 respuestas
Publicado el 10,julio 2015 - 18:05
Is it possible to create controls in a Report? I have a report I want to run with lots of totals, but I don't know how many item totals there will be. I've tried using the following code in the opening of the report, reading the data, initializing body, and before printing body. I get an error every time:

Error at line 2 of Before printing BODY process.
ControlCreate function called.
No current window for creating .
Specify a full name.

FOR i = 1 _TO_ ArrayCount(arrTotals) ControlCreate("ITEM_" + i,typStatic,50+nOffSet,50+nOffSet,100,24) {"ITEM_"+i,indControl} = arrTotals[i,1] nOffSet += 30 END
Publicado el 10,julio 2015 - 18:19
As far as i know ControlCreate only works for window controls.
In reports you can use ControlClone, in this case you must have at least one control of this type in the report and you can copy it as many times as you need.
You can change the properties of the new control, by instance the original control is invisible and you need the new ontrol to be visible.

Almost 80% of all the prints in our apps are using the same report based on ControlClone.

http://doc.windev.com/en-US/…
Publicado el 10,julio 2015 - 18:27
Thank you! I'm surprised you can use clone, but not create.
Publicado el 10,julio 2015 - 18:32
Yes it's strange but controlclone exists since version 9 and controlcreate born only in version 19.

Maybe in some future version but if it changes at the same speed probably in version 29.;)