Hi MHoel and welcome,
You don't need code for this.
Just add a print view and associate it to the view that you want to use it when the user clicks ctrl-P, Print.
It's in the Page View tab on the ribbon. Click on properties for the view and the Print tab should allow you to associate a separate view to print.
Good luck!