Question about what to put as swf file in TableTools
Question about what to put as swf file in TableTools
Hello,
DataTables is a great plugin, and I've really enjoyed using it so far. I'm a very new programmer with no experience with tabletools or swf paths whatsoever. I'm trying to implement Table Tools to print/export/etc but so far only print is working for me. Most solutions have said that means the swf path is incorrect. But I have no idea what to put as my swf path. Could anybody please help? Sorry for such a basic question. :(
Here are my plugins and script for dataTables.
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<link rel="stylesheet" href="http://maxcdn.bootstrapcdn.com/bootstrap/3.2.0/css/bootstrap.min.css">
<link rel="stylesheet" href="http://maxcdn.bootstrapcdn.com/bootstrap/3.2.0/css/bootstrap-theme.min.css">
<script src="http://maxcdn.bootstrapcdn.com/bootstrap/3.2.0/js/bootstrap.min.js"></script>
<script src="http://code.jquery.com/jquery.min.js"></script>
<script src="js/bootstrap.min.js"></script>
<link rel="stylesheet" type="text/css" href="//cdn.datatables.net/1.10.2/css/jquery.dataTables.css">
<script type="text/javascript" charset="utf8" src="//cdn.datatables.net/1.10.2/js/jquery.dataTables.js"></script>
<script type="text/javascript" charset="utf-8" src="https://datatables.net/release-datatables/extensions/TableTools/js/dataTables.tableTools.js"></script>
<link rel="stylesheet" href="https://datatables.net/release-datatables/extensions/TableTools/css/dataTables.tableTools.css" />
<script>
$(document).ready(function () {
$('#table_id').DataTable({
"dom": 'T<"clear">lfrtip',
"tableTools": {
"sSwfPath": "/swf/copy_csv_xls_pdf.swf"
}
});
});
</script>
This question has an accepted answers - jump to answer
Answers
Where is the SWF file on your server?
The above code suggests that it is in the web root directory inside a directory called
swf
.Allan
Well I believe the swf file is under "\*****1\dfs\Users*****.******\Downloads\DataTables-1.10.2\DataTables-1.10.2\extensions\TableTools\copy_csv_xls_pdf" but when I put that in front of sSwfPath, it still isn't working. :/
To be blunt, I'm not totally sure what a swf path is and how I can find it on my computer...
Is the SWF file available inside the http documents directory for your web-server (I am assuming you are using a web-server, the swf file won't work using
file://
- that's an Adobe security restriction)? If so, what is that full path and also the path to your http docs?Allan