Report based on Collection

Cust First NameCust Last NameCust Street Address1Cust Street Address2Cust CityCust StateCust Postal CodeCust EmailPhone Number1Phone Number2UrlTagsCustomer idCredit limit
JohnDulles45020 Aviation Drive-SterlingVA20166john.dulles@email.com703-555-2143703-555-8967http://www.johndulles.com-11000
WilliamHartsfield6000 North Terminal Parkway-AtlantaGA30320-404-555-3285--REPEAT CUSTOMER21000
EdwardLogan1 Harborside Drive-East BostonMA02128-617-555-3295--REPEAT CUSTOMER31000
FrankOHare10000 West OHare-ChicagoIL60666-773-555-7693---41000
FiorelloLaGuardiaHangar CenterThird FloorFlushingNY11371-212-555-3923---51000
AlbertLambert10701 Lambert International Blvd.-St. LouisMO63145-314-555-4022---61000
EugeneBradleySchoephoester Road-Windsor LocksCT06096-860-555-1835--REPEAT CUSTOMER71001
  • 1 - 7

Notes

Not so much a Debugging Demo, more a Performance improvement idea.

Imagine you have a very costly query (joins, amount of data, whatever) and need to offer it's data in an interactive report.

Now the problem is, that with every user interaction (filter, pagination, grouping, ...) that costly query gets executed again.

APEX Collections come to the rescue: in a pre-rendering (before-header) process we create a collection based on that costly query and then base our interactive report on that collection.

Now activate debug and see for yourself. That original and costly query is executed just once on page load, everything else happening in the report gets its data from the APEX Collection.