Print button only prints 1 page
Print button only prints 1 page
stweeet
Posts: 1Questions: 1Answers: 0
Hello guys
I just tried out the button plugin, but when i use the print button print preview only shows 1/1 page, tho there should be more pages.
(only some of the rows comes on)
This discussion has been closed.
Answers
Happy to take a look if you link to the page showing the issue.
Allan
I am having a similar issue. Sadly, I cannot provide a link to the page. What else could I provide?
If you are using server side process then see this FAQ.
If not then looking at your code is needed to start troubleshooting.
Kevin
Thanks, Kevin. I am not using server side. Below is my code. BTW, my data source is a SharePoint 2013 list. tia.
OK, that didn't turn out like expected...let me try again...
You just needed to use back ticks rather than quote marks for the code highlighting. I'ved edited it now.
How many rows of data are there in
data.d.results
? Your default view for the DataTable is 25 records - are you saying that even if you have more than 25 records in the results object, only 25 are shown in the print?Allan
Hi Allen,
Thanks.
It doesn't appear to matter what value I select for the pageLength and, therefore; the number of displayed rows.
When I click the PRINT button, I see all the records that are returned based upon the search criteria. For example, the default is to return the last 5 days worth of files from the list. Currently, that is 77 records. When I click the PRINT button, I see all 77 records. BUT, when I print, only 1 page worth of items are printed. In this case, 17 records. (The # of items changes based upon the length of the Document Link value and the wrapping of the text.) Also, if I "print" to Adobe PDF, I only get 1 page worth of items.
I took the example from the web site where the table values are hard coded in the html page and added the same Links to css files and loading the same js libraries as above and I was able to display the table as wanted and the PRINT button worked as advertised, all pages printed. Also, I was able to display the PDF button and have it work as advertised. The PDF button does not work with my example, but not an issue at this point. So, I am wondering if returning the data via a REST statement makes a difference.
thanks again,
David
Hi David,
It shouldn't. As Kevin mentioned above server-side processing will effect the export options, but you aren't using server-side processing from the above code, so there shouldn't be a problem.
This example Ajax loads the data, and you'll be able to see there that all of the rows are included in the exported files.
Allan
The issue is a css trouble
@media print {
body
{
border-top: hidden;
width: 100%;
height: auto;
}
}