IF Rec.FINDSET THEN REPEAT IF Rec.BOOLEAN = TRUE THEN REPORT.RUN(500XX,FALSE,TRUE,Rec); * Not working //MESSAGE('Customer ID is %1',Rec."ID") * Working fine UNTIL Rec.NEXT = 0;
IF Rec.FINDSET THEN REPEAT IF Rec.BOOLEAN = TRUE THEN BEGIN Rec2 := Rec; // use the record currently active in the loop Rec2.SETRECFILTER; // use ONLY this record REPORT.RUN(500XX, FALSE, TRUE, Rec2); END; UNTIL Rec.NEXT = 0;
Rec.SETRANGE(BOOLEAN, TRUE); IF Rec.FINDSET THEN REPEAT RunLabelReport(Rec); UNTIL Rec.NEXT = 0; LOCAL RunLabelReport(CurrentRec : Record "User") CurrentRec.SETRECFILTER; REPORT.RUN(500XX, FALSE, TRUE, CurrentRec);
PrintLabelsForMarkedLines() LocalRecordVariable.COPY(Rec); LocalRecordVariable.SETRANGE(BOOLEAN, TRUE); IF LocalRecordVariable.FINDSET THEN REPEAT RunLabelReport(LocalRecordVariable); UNTIL LocalRecordVariable.NEXT = 0;
PrintLabelsForLines - OnAction() CurrPage.SubPageName.PAGE.PrintLabelsForMarkedLines;
Answers
Like this:
Then you need to properly indent it, but it will look like this:
RIS Plus, LLC
Can you suggest me any source where to study reports in detail, especially how their call works?
I don't understand why even if i call the report in the loop, it does not get the values of the next iterations, but runs multiple time with the values of the first record.
I hope this helps.
Best Regards,
Thomas
Both solutions work perfectly, thanks.
Is there a clean way to call the records from the part page so i can run the report with them?
First thing would be to create a global(!) function in the subpage doing the job itself. There I would create a local record variable of the same type as the Rec of the subpage. Thgias is to make the function work on the same data but leave Rec untouched. Something like:
You could call such a function from the subpage menu also, but if you want to use it from the main page, you need to create an action there and use the following syntax:
SubPageName must be the name the subpage is given in the main page (here pages 42 / 46 may also be an example).