Report out component P1 to P2 distance

I’d like to report out the distance between P1 and P2 for a list of components

Q CONST DIST P1 TO P2 works in the command line but i haven’t been able to get it to work in a report.