PC SOFT

FORUMS PROFESSIONNELS
WINDEVWEBDEV et WINDEV Mobile

Accueil → WEBDEV 2024 → Auto fill report with values from Page
Auto fill report with values from Page
Débuté par Thomas Rogers, 08 aoû. 2017 08:14 - Aucune réponse
Posté le 08 août 2017 - 08:14
Hello

I have different Pages with forms to be filled out by the user and then a report is generated with the corresponding values.

So far what I do is:
STC_VersNr = PAGE_Form_AI.EDT_Vers_Nr
STC_Name = PAGE_Form_AI.EDT_Name
STC_Vorname = PAGE_Form_AI.EDT_Vorname

and so on

Is there a way to automating if the fields are named the same on both (except the prefix)?
I was thinking about a loop over the Page to get all controls and then "map" it with the respective one on the report.

This is what I have so far:

PROCEDURE GetFormContent(sFormName is string, sReportName)
i is int = 1
j is int = 1
FormControl is string
FormControl = EnumControl(sFormName, i)

RepControl is string
RepControl = EnumControl(sReportName , j)

WHILE FormControl <> ""
FormControl = EnumControl(sFormName, i)

IF Contains(FormControl,"EDT") THEN
controlName is string = Middle(FormControl,5)

WHILE RepControl <> ""
IF Contains(RepControl, controlName) THEN

END
END
END
i++
END

Now I don't know how to access the report controls or even the Page control content as with "EnumControls" I have strings afterwards.

Any idea to my problem?

Thank you