DataTables
Advanced interaction
features for your tables.
Editor
Comprehensive editing
library for DataTables.
Manual
Download
Examples
Manual
Reference
Extensions
Plug-ins
Blog
Forums
Discussions
Sign In
Support
FAQs
Download
Purchase
≡
Show site navigation
not scalable
not scalable
Sudipta
Posts: 23
Questions: 0
Answers: 0
January 2013
edited January 2013
in
General
Hi,
my debug code is amawil. In my table i have one column with very large data. The generated pdf is not formatted well. The header part was appearing twice.
Replies
allan
Posts: 64,688
Questions: 1
Answers: 10,697
Site admin
January 2013
I suspect this is a limitation of the PDF export, although I don't know why the header would be showing twice. Can you link to a test case please?
Allan
Sudipta
Posts: 23
Questions: 0
Answers: 0
January 2013
[code]
<%--
Document : newjsp
Created on : 3 Dec, 2012, 3:35:16 PM
Author : Training
--%>
<%@page contentType="text/html" pageEncoding="UTF-8"%>
<!DOCTYPE html>
@import "custom_style.css";
table.dataTable {
/*margin: 0 auto;*/
/*clear: both;*/
width: 100%;
/*top: 10000px;*/
/*:left: 10000px;*/
}
JSP Page
Your scrolling text goes here
First Name
Last Name
Salary
Place
Place
<% for (int i = 1; i <= 2; i++) {
String s = "";%>
Taher
TINWALA
1000<%=i%>
<% for (int j = 0; j < 815; j++) {%>
<%
s += j + " ";
// if (j % 10 == 0) {
%>
<%
// s = "";
// }
%>
<%}%>
<%=s%>
Hi
Bye
<% if (i % 2 == 0) {%>
<%= i%>
<%}%>
<% }%>
Column 1
Column 2
Column 3
Column 4
First Name
Last Name
Salary
Place
<% for (int i = 1; i <= 20; i++) {%>
Taher
TINWALA
1000
<%=i%>
<% }%>
function getdate(){
var today = new Date();
var dd = today.getDate();
var mm = today.getMonth()+1; //January is 0!
var yyyy = today.getFullYear();
if(dd<10){dd='0'+dd} if(mm<10){mm='0'+mm} today = mm+'-'+dd+'-'+yyyy;
return today;
}
var XlsExtension=".xls";
var PdfExtension=".pdf";
//document.write(today);
$(document).ready(function(){
TableTools.DEFAULTS.aButtons = [ {
"sExtends": "pdf",
"sPdfOrientation": "landscape",
//"sPdfOrientation": "landscape",
///"fnMouseover": function ( nButton, oConfig, oFlash ) {
// alert( 'Mosue over' );
//},
"sButtonText": "",
//"sTitle":"amc",
"sToolTip": "Convert to PDF",
"sFileName": "*"+".pdf"+PdfExtension
},
{
"sExtends": "xls",
// "sButtonText": " Save for Excel "
"sFileName": "*.xls"+XlsExtension
//"sTile": "my title"
} ];
TableTools.DEFAULTS.sSwfPath="copy_csv_xls_pdf.swf";
//TableTools.DEFAULTS.sSwfPath="ZeroClipboard.swf";
$("#table_id").dataTable({
"iDisplayLength": 30,
"bJQueryUI": true,
"sDom": 'T<"H"r>t<"F"ip>'
});
$("#table_id_").dataTable({
"iDisplayLength": 30,
"bJQueryUI": true,
"sDom": 'T<"H"r>t<"F">'
});
});
/* $(document).ready( function () {
$('#table_id').dataTable( {
"iDisplayLength": 30,
"bJQueryUI": false,
"sPaginationType": "full_numbers",
"sDom": 'T<"H"r>t<"F">',
"oTableTools": {
"sSwfPath": "copy_csv_xls_pdf.swf",
"aButtons": [
{
"sExtends": "copy",
"sButtonText": " Copy to clipboard "
},
{
"sExtends": "pdf",
//"sPdfOrientation": "landscape",
///"fnMouseover": function ( nButton, oConfig, oFlash ) {
// alert( 'Mosue over' );
//},
"sButtonText": "",
"sToolTip": "Convert to PDF",
"sFileName": "*"+getdate()+".pdf"
},
{
"sExtends": "xls",
// "sButtonText": " Save for Excel "
},
{
"sExtends": "print",
//"sButtonText": "print"
}
]
/*"aButtons": [
{
"sExtends": "print",
"fnInit": function(node){formatTableToolsButton(node, 'ui-icon-print');}
}
]*/
// }
//} );
// } );
[/code]
this is my test case. The table with id table_id is showing the problem.
This discussion has been closed.
Sign In
·
Register
Howdy, Stranger!
It looks like you're new here. If you want to get involved, click one of these buttons!
Sign In
Register
Quick Links
Categories
Recent Discussions
Unanswered
Categories
75.1K
All Categories
57
Priority support
24.6K
Free community support
1K
General
14
Announcements
2.6K
DataTables
130
DataTables 2
1.3K
DataTables 1.10
93
DataTables 1.9
35
DataTables 1.8
9
CloudTables
2.3K
Editor
2.8K
Extensions
20
AutoFill
314
Buttons
34
ColReorder
4
ColumnControl
34
DateTime
68
FixedColumns
51
FixedHeader
31
KeyTable
106
Responsive
24
RowReorder
43
Scroller
168
SearchBuilder
200
SearchPanes
107
Select
27
StateRestore
220
Bug reports
68
Feature requests
101
Plug-ins
11
Blog
73
Web-site
Replies
Allan
<%--
Document : newjsp
Created on : 3 Dec, 2012, 3:35:16 PM
Author : Training
--%>
<%@page contentType="text/html" pageEncoding="UTF-8"%>
<!DOCTYPE html>
@import "custom_style.css";
table.dataTable {
/*margin: 0 auto;*/
/*clear: both;*/
width: 100%;
/*top: 10000px;*/
/*:left: 10000px;*/
}
JSP Page
Your scrolling text goes here
First Name
Last Name
Salary
Place
Place
<% for (int i = 1; i <= 2; i++) {
String s = "";%>
Taher
TINWALA
1000<%=i%>
<% for (int j = 0; j < 815; j++) {%>
<%
s += j + " ";
// if (j % 10 == 0) {
%>
<%
// s = "";
// }
%>
<%}%>
<%=s%>
Hi
Bye
<% if (i % 2 == 0) {%>
<%= i%>
<%}%>
<% }%>
Column 1
Column 2
Column 3
Column 4
First Name
Last Name
Salary
Place
<% for (int i = 1; i <= 20; i++) {%>
Taher
TINWALA
1000
<%=i%>
<% }%>
function getdate(){
var today = new Date();
var dd = today.getDate();
var mm = today.getMonth()+1; //January is 0!
var yyyy = today.getFullYear();
if(dd<10){dd='0'+dd} if(mm<10){mm='0'+mm} today = mm+'-'+dd+'-'+yyyy;
return today;
}
var XlsExtension=".xls";
var PdfExtension=".pdf";
//document.write(today);
$(document).ready(function(){
TableTools.DEFAULTS.aButtons = [ {
"sExtends": "pdf",
"sPdfOrientation": "landscape",
//"sPdfOrientation": "landscape",
///"fnMouseover": function ( nButton, oConfig, oFlash ) {
// alert( 'Mosue over' );
//},
"sButtonText": "",
//"sTitle":"amc",
"sToolTip": "Convert to PDF",
"sFileName": "*"+".pdf"+PdfExtension
},
{
"sExtends": "xls",
// "sButtonText": " Save for Excel "
"sFileName": "*.xls"+XlsExtension
//"sTile": "my title"
} ];
TableTools.DEFAULTS.sSwfPath="copy_csv_xls_pdf.swf";
//TableTools.DEFAULTS.sSwfPath="ZeroClipboard.swf";
$("#table_id").dataTable({
"iDisplayLength": 30,
"bJQueryUI": true,
"sDom": 'T<"H"r>t<"F"ip>'
});
$("#table_id_").dataTable({
"iDisplayLength": 30,
"bJQueryUI": true,
"sDom": 'T<"H"r>t<"F">'
});
});
/* $(document).ready( function () {
$('#table_id').dataTable( {
"iDisplayLength": 30,
"bJQueryUI": false,
"sPaginationType": "full_numbers",
"sDom": 'T<"H"r>t<"F">',
"oTableTools": {
"sSwfPath": "copy_csv_xls_pdf.swf",
"aButtons": [
{
"sExtends": "copy",
"sButtonText": " Copy to clipboard "
},
{
"sExtends": "pdf",
//"sPdfOrientation": "landscape",
///"fnMouseover": function ( nButton, oConfig, oFlash ) {
// alert( 'Mosue over' );
//},
"sButtonText": "",
"sToolTip": "Convert to PDF",
"sFileName": "*"+getdate()+".pdf"
},
{
"sExtends": "xls",
// "sButtonText": " Save for Excel "
},
{
"sExtends": "print",
//"sButtonText": "print"
}
]
/*"aButtons": [
{
"sExtends": "print",
"fnInit": function(node){formatTableToolsButton(node, 'ui-icon-print');}
}
]*/
// }
//} );
// } );
[/code]
this is my test case. The table with id table_id is showing the problem.