How to start - confused
How to start - confused
Hi
I am trying to export data from my table to Excell. However I cannot even start the dataTable. Am I doing some dummy mistake somewhere?
This is my exemplary code which does not work:
[code]
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
TEST
$(document).ready(function () {
$('#example').dataTable({
"sDom": 'T<"clear">lfrtip',
"oTableTools": {
"sSwfPath": "/js/copy_cvs_xls_pdf.swf"
}
});
});
1
2
3
4
5
6
7
8
9
[/code]
Its rather simple website and I would like to be able to export this table to excell. I have even imported all of the js files to make sure I do not miss anyone. PLEASE HELP I AM CONFUSED !!!
Regards,
Bartosz
I am trying to export data from my table to Excell. However I cannot even start the dataTable. Am I doing some dummy mistake somewhere?
This is my exemplary code which does not work:
[code]
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
TEST
$(document).ready(function () {
$('#example').dataTable({
"sDom": 'T<"clear">lfrtip',
"oTableTools": {
"sSwfPath": "/js/copy_cvs_xls_pdf.swf"
}
});
});
1
2
3
4
5
6
7
8
9
[/code]
Its rather simple website and I would like to be able to export this table to excell. I have even imported all of the js files to make sure I do not miss anyone. PLEASE HELP I AM CONFUSED !!!
Regards,
Bartosz
This discussion has been closed.
Replies
Bartosz
Even though I have added this bit to the head of the page
[code]
@import "/Styles/demo_page.css";
@import "/Styles/demo_table.css";
[/code]
It still does not seem to work
Bartosz
[code]
Col A
Col B
Col C
1
2
3
4
5
6
7
8
9
[/code]
Thanks for help. Couple more questions however. I cannot run any of the functions from the top buttons apart of "print". I have noticed the same issue with examples from the download folder. When I open examples on the datatable.net website, after clicking Excel dialog box with destination folder appears. When I do the same with examples provided in download folder nothing happens (the same as in my application). Why is it so? Is it normal behavior? Does a website need to have any server side script to make it work?
Regards
Bartosz
Sorry. One more question. Are those and elements absolutely necessary. Final table I am planning to use for this plugin runs as .aspx website. I create it dynamically from database every time the page opens. I really don't know how could I implement those two tags within the table structure while creating it. Mostly because I use controller to build it up.
Any help highly appreciated!!!!!!!
Bartosz
I don't use TableTools often, so I can't help you with your other question.
> I cannot run any of the functions from the top buttons apart of "print"
This is almost certainly because the SWF file isn't being loaded (or you might not have the Flash plugin). Make sure that sSwfPath is pointing to the right file, and that you aren't getting any 404 errors in the server error log.
Allan