• Resolved huotg01

    (@huotg01)


    Hi

    I use an embedded (iFrame) Excel spreadsheet as a specialized calculator on a web page. The calculator allows users to capture some information, and see the result.
    I’m trying to allow the user to print its scenario.

    So far nothing worked, and then…the light : Print-O-Matic Version 2.1.10 ??

    I know that it is simple, but I had no success so far. The preview page doesn’t display the sheet.

    First question: should the plugin work when trying to print the content of an iFrame with an embedded spreadsheet ?

    Second question: I can either use iFrame or Java script code to bring the sheet on the web page. Should it work also with Java script ?

    Here is the code (the “scripts” were for trying things):

    <div id="print_target">This is the simple print target for the page
    [print-me target="#print_target"]
    <iframe id="biq" width="402" height="346" frameborder="0" scrolling="no" src="https://bitumequebecorg.sharepoint.com/sites/BiQ2/_layouts/15/Doc.aspx?sourcedoc={452dbd74-22e5-40c8-8808-81ec80fa6b5a}&action=embedview&wdAllowInteractivity=False&wdHideGridlines=True&wdHideHeaders=True&wdDownloadButton=True&wdInConfigurator=True&wdInConfigurator=True&edesNext=false&resen=true&ed1JS=false"></iframe>
    </div>
      <button onclick="printBiQ()">Print iframeBiQ</button>
    [print-me target="biq"/]
    
    <script> function printBiQ() {       
        var iframe = document.getElementById('biq');       
        var iframeWindow = iframe.contentWindow;       
        iframeWindow.focus();       
        iframeWindow.print();     
      }   
    </script>
    
    <iframe id="myIframe" src="https://guignoleerivesud.org/atestforiframe/"></iframe>
    <button onclick="printIframe()">Print iframex1</button>
    <button onclick="printIframe2()">Print iframex2</button>
    [print-me target="myIframe"/]

    Thanks
    Gaston

    The page I need help with: [log in to see the link]

Viewing 8 replies - 1 through 8 (of 8 total)
  • Thread Starter huotg01

    (@huotg01)

    The link to the javascript version: https://guignoleerivesud.org/atest-print-jscript/

    <div id="myExcelDiv" style="width: 402px; height: 346px">
    <!-- * This code uses the Microsoft Office Excel Javascript object model to programmatically insert the
    	 * Excel Web App into a div with id=myExcelDiv. The full API is documented at
    	 * https://msdn.microsoft.com/fr-CA/library/hh315812.aspx. There you can find out how to programmatically get
    	 * values from your Excel file and how to use the rest of the object model. -->
    <script type="text/javascript" src="https://onedrive.live.com/embed?resid=58E6B2E7CDC672D3%21384&authkey=%21AGaV9-2Pw4YCwiY&em=3&wdDivId=%22myExcelDiv%22&wdHideGridlines=1&wdAllowInteractivity=1&wdAllowTyping=1"></script>
    </div>
    [print-me target="#myExcelDiv"/]

    • This reply was modified 1 year, 10 months ago by huotg01.
    Plugin Contributor twinpictures

    (@twinpictures)

    So a user must first log in before using the spreadsheet, correct? This spreadsheet seems to be hosted at bitumequebecorg.sharepoint.com. Do you have access to this, or is this a third-party service? What happens when you hit Ctrl+P or use the browsers print function? Does the spreadsheet print at all using the standard browser print?

    Thread Starter huotg01

    (@huotg01)

    Sorry for the long delay to come back here. I was “out of service”…
    I built another, and simpler bed test:

    Here is the URL:

    https://guignoleerivesud.org/atest-print-jscript/

    Here is the code used to build the web page.

    <div id="myExcelDiv" style="width: 402px; height: 346px">
    <script type="text/javascript" src="https://onedrive.live.com/embed?resid=58E6B2E7CDC672D3%21384&authkey=%21AGaV9-2Pw4YCwiY&em=3&wdDivId=%22myExcelDiv%22&wdHideGridlines=1&wdAllowInteractivity=1&wdAllowTyping=1"></script></div>
    [print-me target="#myExcelDiv"/]
    <iframe id="excel" width="402" height="346" frameborder="0" scrolling="no" src="https://bitumequebecorg-my.sharepoint.com/:x:/g/personal/tic_bitume_quebec1/EYi9K47PNs1HrtL76chXWm8Bqt6IObi7_r1cIIA_GVs9zw?e=o3xNTw&action=embedview&wdAllowInteractivity=True"></iframe>
    [print-me target="#excel"/]

    I did try to upload some screenshots, but I’m not sure it worked The 2 spredsheets will sho on the page, but not on the print preview.

    Tell me is the “call” to Print-me is ok.

    Thanks
    Gaston

    Print-o-Matic 1.png

    Thread Starter huotg01

    (@huotg01)

    Print-o-Matic 2.png

    Ok, it seems that I can display the screenshots. The last one (Print-o-Matic 2.png) is the print preview of the second spreadsheet.
    Thanks

    Gaston

    Thread Starter huotg01

    (@huotg01)

    Could it be a cross origin issue ?

    Thread Starter huotg01

    (@huotg01)

    Could we expect an answer, or it’s a case of “just too bad” ?

    Plugin Contributor twinpictures

    (@twinpictures)

    If the content that you are attempting to print is in an iFrame and the iFrame’s content is coming from another domain, then, yes it’s a cross-domain issue.

    You might also want to adjust your expectations from free community support on free plugins.

    Thread Starter huotg01

    (@huotg01)

    I’m really sorry if I hurt you. I thought that there was a “pro” version”, and it was what I was looking for. This is the only place that gives support. I think that we should always support the developpers.

    I was desperatly searching for a solution, and I just wanted to know if my conclusion that it wouldn’t work in my situation was correct in order to take another direction.

    Thanks,

    Gaston

Viewing 8 replies - 1 through 8 (of 8 total)
  • The topic ‘Trying to print an iFrame embedded spreadsheet’ is closed to new replies.