cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

Community Tip - Did you get called away in the middle of writing a post? Don't worry you can find your unfinished post later in the Drafts section of your profile page. X

Printing a Mashup on runtime

Janicen
16-Pearl

Printing a Mashup on runtime

Good day, everyone

 

I am trying to print my webpage/mashup, (an image just for now).

Following this article guide: https://www.ptc.com/en/support/article/CS319138

I wrote the below in a service and I invoke this service on a button click with the hopes of getting the print page to open up (Like how it would when you press Ctrl+P).

This isn't working. Is there something I am missing?

 

The code: 
let table = Resources["InfoTableFunctions"].CreateInfoTableFromDataShape({
infoTableName: "InfoTable",
dataShapeName: "dataShape_DS"
});
let html = "window.open('http://xx.xx.co/:port/Thingworx/MediaEntities/Icon'); html.print()";table.AddRow({htmlColumn:html});
result = table.htmlColumn;

ACCEPTED SOLUTION

Accepted Solutions

I have tested in my local and it's working fine with value display. I tried as follow,

  1. Create a persistent  property (name: html_property) with HTML as a base type
  2. Set below string as a property value
    <button onclick="let WindowReferenceObj = window.open('http://localhost:8080/Thingworx/MediaEntities/AcknowledgeAlertIcon'); WindowReferenceObj.print();">Print</button>
  3. Write service which return the property value and output as HTML
    result = me.html_property
  4. Create a mashup with Value display and render as HTML

View solution in original post

1 REPLY 1

I have tested in my local and it's working fine with value display. I tried as follow,

  1. Create a persistent  property (name: html_property) with HTML as a base type
  2. Set below string as a property value
    <button onclick="let WindowReferenceObj = window.open('http://localhost:8080/Thingworx/MediaEntities/AcknowledgeAlertIcon'); WindowReferenceObj.print();">Print</button>
  3. Write service which return the property value and output as HTML
    result = me.html_property
  4. Create a mashup with Value display and render as HTML
Announcements


Top Tags