How to display a PPT as part of the widget?

vidhya_mouli
Giga Sage

I have a widget with the following code:

 

HTML:

<div>
<h1>
  Display PPT
  </h1>
    <p>  {{data.IncidentNumber}}  </p>
  
<div id="ppt-widget">
    <iframe src="$viewer.do?sysparm_stack=no&amp;sysparm_sys_id=f2253344830e42102a921630ceaad3d1" width="100%" height="100%"> </iframe>
  </div>

</div>

 

Server Script:

(function() {
    var incidentSysId = '35e47f48830e42102a921630ceaad374';
    var gr = new GlideRecord('incident');
    if (gr.get(incidentSysId)) {
        data.IncidentNumber = gr.getDisplayValue("number");
    } else {
        data.IncidentNumber = 'Incident not found';
    }

})();

 

However this is prompting me to download the presentation. I want to display it directly. How to do this?

1 ACCEPTED SOLUTION

vidhya_mouli
Giga Sage

Finally made it work:

Enabled document viewer and added this to the widget.


<div id="ppt-widget">
<iframe src='https://<<myinstance>>.service-now.com/$viewer.do?sysparm_stack=no&sysparm_sys_id=f2253344830e42102a921630ceaad3d1' width='100%' height='100%' frameborder='0'></iframe>
</div>

View solution in original post

6 REPLIES 6

vidhya_mouli
Giga Sage

Finally made it work:

Enabled document viewer and added this to the widget.


<div id="ppt-widget">
<iframe src='https://<<myinstance>>.service-now.com/$viewer.do?sysparm_stack=no&sysparm_sys_id=f2253344830e42102a921630ceaad3d1' width='100%' height='100%' frameborder='0'></iframe>
</div>

I am still getting the same issue.


Steps performed:

1. Verified Document Viewer Plugin installation -->Installed

2. Set the property 'com.snc.documentviewer.enable_document_viewer' to true

3. Added the widget with the above code

 

But the below is the screenshot of the widget

KRafi_0-1719232482070.png