tags:

views:

17

answers:

2

How to print the datatable values using jsp ?

i need to print(hardcopy) of all datatable values in jsp.

I used the javascript function for open printer dialog:

function callsubmit(){

window.print();
window.opener.document.location = window.opener.document.location.href;
window.close();

  }

But this option pringing the whole page.but in this case i need datatable values only. I am not able use media="print".Because it is just hiding the section the page.But datatable have scrollbar or pageination this option won't work.

What is the option to print datatable values using jsp ?

A: 

Create a new JSP page which displays only the datatable and not the other sections and open and print it instead.

It's either that or fixing your poor HTML structure so that you can take advantage of CSS media rules as I answered in your previous question.

BalusC
A: 

Thank you BalusC. So that i have used button on click onClick="window.open('/html/viewpdf.jsp','mywindow','width=500,height=350,toolbar=no,resizable=yes')">

This will open another jsp, so datatable values display in the popupwindow and there should give print.in the portal there is opening the new popup window but that is not jsp.it like liferay homepage only.

So that i have asked question how to use to open the popup window in liferay portal.

vinoth