Sort records in a report from Detail View

7.11.6

Hey all,

I would eventually like to be able to sort records in a generated report from the detail view using the arrows and methods in other subpanels/list views, but am currently only at trying to override the current sort_by value for specific fields, for example:

when attempting to have the report sort by amount by default, I tried adding the following code to AOR_Report.php right before the statement listed after


	    if ($field->label == 'amount') {
		$field->sort_by = 'DESC';
	    }
	    else {
		$field->sort_by = '';
	    }

            if ($field->sort_by != '') {
                $query_array['sort_by'][] = $field_label . ' ' . $field->sort_by;
            }

but am unable to even break the current sorting specifics. Am I going about this the wrong way, does anyone have a suggestion on how I could do this another way or have any suggestions for me moving forward with this? Thank you for your time and thought in advance