How we can generate Links kind of report

how we can generate Links kind for reports .
data should be from query may be.

This is a custom scripted report. https://github.com/frappe/frappe/blob/develop/frappe/public/js/frappe/form/linked_with.js