how to define openURL function with ID of current record

how to define openURL function with ID of current record

In my reports i want a VIEW button to show the record much like the "View Record" button does in the most left column.
Just to have a quick link to view the record in a popup.

My function looks like this:

void view_tmrt_record()
{
    openUrl("/record-summary/test_report/"+ input.ID +"/", "Popup window", "height=500,width=500");
}

but it gives the error 'variable ID not defined' . I thought input.ID automatically fetches the ID of the current record.

Thanks for any feedback