Hey guys!
So i have following problem, i have to add copy loop functionality to our Posted Sales Shipment Invoice report, and ive been doing HUGE research and red this https://blogs.msdn.microsoft.com/nav/2017/01/24/how-to-implement-a-copy-loop-in-word-report-layouts/ so many times and it still doesnt work. Im using RDLC as my report style.
So i decide ill try to copy copy loop from one of Microsoft reports, but it now generates report for like 2 minutes and displays only 1 page and page numbering doesnt reset. Here is what code looks like.
CopyLoop - OnPreDataItem()
NoOfLoops := ABS(NoOfCopies) + Cust."Invoice Copies" + 1;
IF NoOfLoops <= 0 THEN
NoOfLoops := 1;
CopyText := '';
SETRANGE(Number,1,NoOfLoops);
OutputNo := 1;
CopyLoop - OnAfterGetRecord()
IF Number > 1 THEN BEGIN
CopyText := Text003;
OutputNo += 1;
END;
CurrReport.PAGENO := 1;
Code In Layout
...Here is original code...
Shared NoOfCopies as integer
Public Function SetNoOfCopies(Value as integer)
NoOfCopies = Value
End Function
Public Function GetNoOfCopies() As integer
Return NoOfCopies
End Function
Also when it finish to generate the report some fields appear blank, but before i added copyloop they were filled with information...
*This post is locked for comments