Problem iterating results from GetUpdatedPackagesWithinDateRange report method
Friday, September 16, 2016 at 08:08amI’m a little confused over how to correctly and completely iterate over the results returned from the esl.PackageService.GetUpdatedPackagesWithinDateRange, as it appears I’m only iterating over the first 10 items.
I have the following code:
PageThe above foreach loop is only executing 10 times. How do I get it to execute for all 28 elements. It is my understanding when I call the “GetUpdatedPackagesWithinDateRange†and pass the parameter “new PageRequest(1)†that ALL the results are in one page. Is this not correct? Do I need to define the PageRequest with some large pagesize parameter as well; i.e. 1000? This is a problem in our production environment, a timely response is much appreciated. Thankspackages = esl.PackageService.GetUpdatedPackagesWithinDateRange(DocumentPackageStatus.SENT, new PageRequest(1), startDate, endDate); //packages has 28 TotalElements if (packages != null && packages.TotalElements > 0) { foreach (DocumentPackage dp in packages) { //processing //only doing 10 iterations //how to do all 28 } }
Reply to: Problem iterating results from GetUpdatedPackagesWithinDateRange report method
Friday, September 16, 2016 at 08:50am