How To…Calculate the Current Print Position

Question

“How do I calculate the current position of a component after it has been generated to a report?”

Solution

Use the OnDrawCommandCreate event of the component to get the current position on the page, then use the conversion utility functions in ppUtils.pas to convert the value into report units.

Download: CalcPrintPosition.zip

Sample Delphi code: