I am trying to export some data via a link to an excel sheet.
I have tried using some classes, but every time I export I get the whole admin page exported with it

I have a link (this is backend BTW) pointing to a file like so:
$record->link_export = $this->CreateLink($id, 'list_export', $returnid, $icon_export, array('invitation_id'=>$record->id));
And in the file action.list_export.php I then try different stuff to get my SQL array exported - but every time I get the WHOLE admin page exported with it (as well as it does not format the data properly)
I have now imported the CMSexcel module - but I am at a loss on how to use it.
Can anyone show me a simple example on how to get my SQL data exported via a link? The help part of that module does not help me at all - any help would be appreciated - does not have to be that module (at the moment I am trying a 3rd party class)