There are different ways for doing that, and it really depends on what you want to do exactly.
The simplest way of doing that would be:
on the ofbiz UI create a link/button pointing to the controller. That is simple if you already have a screen created with widgets.
Then add a java event to the controller. Your event method will get as parameters servlet request and response objects. Inside that method create your excel file, prepare it, and write it to response object's output stream.
The response type in your controller entry should be "none" because you are manually writing the response in your event. So you don't need to render a new screen or anything.
The effect will be that, whenever the user clicks on the button, it will call the controller, which in turn will return the excel file.
HTH