Results 1 to 2 of 2

Thread: Print Tab Panel Content

  1. #1
    Sencha User
    Join Date
    May 2014
    Posts
    11

    Default Print Tab Panel Content

    Hi, i want print a tab panel as pdf with their contents.

    The tab panel is this
    Code:
    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

    Code:
    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
    Schermata 2014-06-06 alle 19.57.28.png

  2. #2
    Sencha - Support Team scottmartin's Avatar
    Join Date
    Jul 2010
    Location
    Houston, Tx
    Posts
    9,410
    Answers
    716

    Default

    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)

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •