Well in that case I would prefer to advise you to use javascript and css. This approach is not only fast but also easy and accurate.
Now how to do that. Well answer is right below:
- Surround the portion with a div in the jsp page you want to print . Donot think about the changes now.
- Call a javascript function say printPage(divPrintId). divPrintId is the id of the div.
- Retrieve the entire text within the div as str=document.getElementById(divPrintId).innerHTML
- Now do the business changes on the innerHTML text.
- For page break you can create a javascript inside printPage javascript like below:
newwin.document.write('pageBreakDetails();\n')
newwin.document.write('function pageBreakDetails(){\n')
newwin.document.write('var details = document.getElementById("form1:tableId").style.pageBreakBefore="always";\n ')
newwin.document.write('}\n')
Let me know if someone finds any difficulty implementing this
Regards
Monu






0 comments:
Post a Comment