Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
Clear All
new posts

    Printing

    Hy guys,I was curios about the Printing support in v7.0 but I didn't find anything in the docs.

    However I've found the example in the FeatureExplorer - and that's what intrigued me more :))


    I've tried this in my code:

    Code:
    isc.IButton.create({
       autoDraw: false,
       ID:"printButton",
       title: "Print Preview",
       click: "isc.Canvas.showPrintPreview(EditPageID)"
      })
    
    Window.create({
            ID:"EditPageID",
            title:"Edit page",
            showShadow:false,
            autoDraw:false,
            canDragReposition:false,
            showMaximizeButton:false,
            showMinimizeButton:false,
            showCloseButton:true,
            headerControls : ["headerIcon","headerLabel",printButton,helperButton,"closeButton"],
            left:0, top:0,
            width:"100%", height:"100%",
            items:[
                    editForm_1,
                    editForm_2
            ]
    });

    I click on Print preview but nothing happens.( I mean nothing. No error, no warn, no nothing neither in DevConsole or in Firebug)
    Where do I go wrong?

    Thanks in advance,
    John
    Last edited by JohnBlack; 15 Nov 2008, 12:34.

    #2
    I'm back with the answer:

    I'm using php:
    but isomorphic\system\helpers\printFrame.jsp will not deliver what I need :)
    Here is my changes:
    I've put isomorphic\system\helpers\printFrame.php
    with the next code:
    Code:
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
    <HTML>
    <HEAD>
    <? // page title is driven by main page via the 'title' parameter to this page
    ?>
    <TITLE><?=$_GET["title"]?></TITLE>
    </HEAD>
    <!-- body overflow: hidden - suppress page level scrollbars -->
    <!-- onafterprint - supported in IE only -->
    <BODY overflow="hidden" onload="pageLoaded()" onafterprint="printed()">
    
    <script>
    // document.write out our skin styles file
    if (window.parent && window.parent.isc) {
        document.write('<LINK REL="STYLESHEET" TYPE="text/css" HREF=' +
                       window.parent.isc.Page.getURL("[SKIN]/skin_styles.css")+
                       ">");
    }
    </script>
    
    <SCRIPT>
    function pageLoaded() {
        window.controllerCanvas = '<?=$_GET["id"]?>';
        parent[controllerCanvas].iframeLoad();
    }
    
    function printed() {
        parent[window.controllerCanvas].printComplete();
    }
    
    function assignHTML(HTML) {
        getPrintElement().innerHTML = HTML;
    }
    
    function getPrintElement() {
        return document.getElementById('printElement');
    }
    
    function doPrint(callback) {
        // focus() required for IE - otherwise it prints the top-level window
        focus();
        print();
    
    }
    
    </SCRIPT>
    
    <span id='printElement'></span>
    
    </SCRIPT>
    </BODY>
    </HTML>
    and in isomorphic\system\development\ISC_Core.js at 3027:84 changed "printFrame.jsp" to "printFrame.php"
    and in isomorphic\system\modules\ISC_Core.js at 2938:84 changed "printFrame.jsp" to "printFrame.php"

    and now everything is working ok (almost ok cause I'm not getting the second parameter which is "title" - but I'm not complaining - it's working without it)

    Comment


      #3
      Hy guys,

      Anything on this one?

      Comment


        #4
        Hi John,

        Docs for print preview are coming. Thanks for posting your PHP solution.

        Comment


          #5
          Great!

          Thanks,
          John

          Comment

          Working...
          X