[dancer-users] Export To Excel

Kadir Beyazlı kadirbeyazli at gmail.com
Sun Sep 20 14:16:45 BST 2015


Hi All,

I have a data listed with html table.
When I click on o a button, I want data to be exported to excel.
With CGI.pm I do it in 2 ways

1-) when clicked on  button, redirect to a sub and   use
Spreadsheet::WriteExcel module
2-) no need to another sub, change header if clicked on button

#set cmd to export when clicked on button and perform POST reques
 if ($q->param('cmd') eq 'export') {
      print $q->header(
    -content_type => "application/vnd.ms-excel",
    -attachment   => Report."-$stamp.xls",
    );
  }

I have 2 questions:

1-) I can apply 1st method at a new route. If I try 2nd method, how
will I change header?
2-) Is there any plugin for export at Dancer2

-- 
Kadir Beyazlı
Computer Engineer
GSM : +90 535 821 50 00


More information about the dancer-users mailing list