How to print data (JSON) from ThingWorx?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
How to print data (JSON) from ThingWorx?
I would like to be able to print (physically, not PDF) a label from a ThingWorx mashup. The data I want to print is a table of values, so that could be presented inside a JSON object, looking like this for example:
- Name: John Doe
- Date: 2017/10/30
- ID: 12345678
As I did not find any built-in ThingWorx widget to do this, my first idea was to develop a custom widget "PrintButton". It would use the Print.js JavaScript library, allowing to print a JSON object from a web browser. As a new JavaScript user, I encounter difficulties to code this, as I can't find a way to make the runtime render work. Would someone have the source code of the button widget? It would help me start on a good basis.
My first question is: is this a good approach, or should I rather develop a custom service in Java to do the print operation?
My second question is: if this is a good idea, how to add an external JavaScript library to an extension Eclipse project?
Thanks,
Antoine
- Labels:
-
Connectivity
-
Extensions
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Hello, Antoine.
This post talk about how to parse JSON object data to get it into a ThingWorx service. It might serve point you in the right direction. Let us know if you have additional questions.
Thanks,
-- Craig A.
