PDA

View Full Version : Print Tab Panel Content



stapeDev
6 Jun 2014, 10:06 AM
Hi, i want print a tab panel as pdf with their contents.

The tab panel is this


var schedaTabInserimentoP= Ext.create('Ext.tab.Panel', {
id:'tabPanelInserimento'+indexWindow,
enableTabScroll: true,
layout: 'fit',
autoScroll: true,
items:[scheda1,scheda2,scheda3,scheda4,scheda5,scheda6,scheda7,scheda8,scheda9,scheda10,scheda11],
});


i have tried with this script



var targetElement = Ext.getCmp('tabPanelInserimento'+indexMod);
var myWindow = window.open('', '', 'width=200,height=100');
myWindow.document.write('<html><head>');
myWindow.document.write('<title>' + 'Title' + '</title>');
myWindow.document.write('<link rel="Stylesheet" type="text/css" href="http://dev.sencha.com/deploy/ext-4.0.1/resources/css/ext-all.css" />');
myWindow.document.write('<script type="text/javascript" src="http://dev.sencha.com/deploy/ext-4.0.1/bootstrap.js"></script>');
myWindow.document.write('</head><body>');
myWindow.document.write(targetElement.body.dom.innerHTML);
myWindow.document.write('</body></html>');
myWindow.print();


but i have this output, the first tab and no content in the form
49258

scottmartin
7 Jun 2014, 7:50 AM
To be honest, I have never liked the client side PDF solutions and they seem to get distorted or incomplete.

I would recommend a server side solution to have consistent results.

http://www.tcpdf.org/ (php, simple to use)
http://itextpdf.com/ (java, more powerful of the 2)