I used following script in my rout file.
Route::get(\'/tasks\', \'appointmentController@exportCsv\')
I used the following Js script Html Clickabl