Print App with only App and no Domo headers.

jaz
jaz Member

Hello,

 

I'm currently having an issue with a custom App I created using the Developer tools. My issue is the fact that my print button does not work at all and I recieve an error of: "Ignored Call to 'print()'. The document is sandboxed, and the 'allow-modals' keyword is not set". 

 

Reading this I understand that my function is not being called because of a setting in Domo. I need my app to be printed on paper with just the App, no website headers, no website footers, just the App. My managers are extremely adamant about that. I need someone to help me figure out how to get it printed, I would have just exported it and then printed it but for some reason my export option is grayed out with this custom app.

 

Can someone tell me the best way I should be approaching this? 

Best Answer

  • jaz
    jaz Member
    Answer ✓

    Hey there! 

     

    I ended up getting sort of an answer, what we ended up doing was adding a button to the app that essentially opens the card into fullscreen mode in another tab and then from there we can print it out. 

     

    The two functions that are being used in the app.js file: 

    $scope.printview = function(){
    domo.navigate("https://b14e33be-5dfa-4ed5-88ba-1ca2c0a912cf.domoapps.prod5.domo.com?printing=true",true)
    }

    $scope.print = function(){
    window.print();
    }

    The URL is the app URL.

     

    Then we added the buttons using this in the HTML file: 

    <button id="printv" ng-click="printview()" ng-hide="isprinting">Print Version</button>
    <button id="print" class="fa fa-print fa-3x" ng-show="isprinting" ng-click="print()"></button>
    <button id="print2" ng-click="print()" ng-show="isprinting">Print Page</button>

    I hope this helps a little bit! 

     

Answers

  • n8isjack-ret
    n8isjack-ret Domo Employee

    Hi @jaz,

     

    There are tight measures on custom apps to ensure that they are sandboxed into their iframe. It gives you free reign to have custom code but keeps code tightly packaged.

     

    You can get this reviewed by submitting a ticked to support@domo.com. They can have our product teams review the possibility of allowing that function.

    Former Domo employee you can find me in the Dojo Community here @n8isjack
  • jaz
    jaz Member

    I was hoping for a different answer to be honest. I understand why it is the way it is, however, I need to be able to print this. I've already created a ticket, however, I really need to get this sorted out ASAP. My managers are waiting on this function and I was previously told I would be able to do this. 

     

    Do you know why the export button is not working? if I could just export it and then print it then that would work as well. I really need a solution to my problem. 

  • @jaz

     

    This one will need to go to the support team so  thay can get the best answer for you in this case.

     

    Thanks!

     

  • Did you ever get a real answer for this? I'm running into the same issue and am hoping you might be able to help from what you learned. I don't understand why we can create the app but not print the app only.

     

    Thanks,

    Elizabeth

  • jaz
    jaz Member
    Answer ✓

    Hey there! 

     

    I ended up getting sort of an answer, what we ended up doing was adding a button to the app that essentially opens the card into fullscreen mode in another tab and then from there we can print it out. 

     

    The two functions that are being used in the app.js file: 

    $scope.printview = function(){
    domo.navigate("https://b14e33be-5dfa-4ed5-88ba-1ca2c0a912cf.domoapps.prod5.domo.com?printing=true",true)
    }

    $scope.print = function(){
    window.print();
    }

    The URL is the app URL.

     

    Then we added the buttons using this in the HTML file: 

    <button id="printv" ng-click="printview()" ng-hide="isprinting">Print Version</button>
    <button id="print" class="fa fa-print fa-3x" ng-show="isprinting" ng-click="print()"></button>
    <button id="print2" ng-click="print()" ng-show="isprinting">Print Page</button>

    I hope this helps a little bit! 

     

  • Thank you! I'll see if this gets us where we need to be until Domo can figure out a better long-term solution.

  • Thanks @jaz for closing the loop here and sharing your solution!

This discussion has been closed.