showing fewer rows in save, csv, excel, pdf

showing fewer rows in save, csv, excel, pdf

techiereddytechiereddy Posts: 1Questions: 1Answers: 0

Hi -

I am new to data tables and I was able to integrate successfully for basic use case. The problem that I am seeing is below:
a) I have 4 rows in my table. They are sent from servlet to jsp and are displayed correctly on the page
b) I am able to print out the table and it has all 4 rows as expected.
c) But for some reason, data tools ( and table tools) seems to think that it has only one row ("Showing 1 to 1 of 1 entries"). Though I can see all 4 rows in printed table. I tried selected any row after first data row and they cannot be selected or not visible from search
d) I am seeing only 1 row when I print using pdf or csv

I would appreciate any help I can get for me to resolve this issue and try out other features. So far, this seems like we have lot of value. Please let me know if you need any additional information. JSP code is below



<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
<%@ taglib prefix="c" uri=""%>

<!DOCTYPE html>

<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>Account Details</title>

<link rel="stylesheet" type="text/css" href="//">
<link rel="stylesheet" type="text/css" href="scripts/dataTables.tableTools.css">

<style type="text/css">
table {
border: 1px solid black;
border-collapse: collapse;
width: 50em;

th,td {
border: 1px solid black;
text-align: left;
padding: .5em;

button {
display: block;
width: 134px;
height: 35px;
border: 0 none;
font-weight: bold;
text-align: center;
color: #fff;
cursor: pointer;
position: relative;
float: left;

excelbutton {

background: red;
padding-left: 0px;
margin-right: 10px;


pdfbutton {

background: green;


<h3 id="titleh3">Account Details</h3>

<c:set var="listSize" scope="session" value="${acctListSize}"/>
<c:set var="acctiden" scope="session" value="${acctid}"/>

<input id="acctid" value="${acctiden}" type="hidden"/>

<table id="accountDataTable" >
        <th>Account ID</th>
        <th>Account ID</th>
    <c:forEach var="account" items="${listHolder.accounts}" begin="0"
        end="${acctListSize}" step="1" varStatus="status">
            <td><c:out value="${account.acctId}" /></td>
            <td><c:out value="${}" /></td>
            <td><c:out value="${}" /></td>

<button id="excelbutton" type="button">Generate Excel Report</button>
<button id="pdfbutton" type="button">Generate PDF Report</button>
<br />


    $(document).ready(function() {
        $("#titleh3").append(" for ID: ").append($("#acctid").val());
         $("#accountDataTable").DataTable( {
                dom: 'T<"clear">lfrtip',
                tableTools: {
                    "aButtons": [
                            "sExtends": "pdf",
                            "sPdfOrientation": "landscape",
                            "sPdfMessage": "Your custom message would go here."
                    "sSwfPath": ""
            } );



This discussion has been closed.