Community Tip - Need to share some code when posting a question or reply? Make sure to use the "Insert code sample" menu option. Learn more! X
Hello everyone,
I am trying to create a custom extension in Thingworx which will generate a PDF file when a user clicks a button. The Thingworx mashup on which this button exists, will have a table full of data ( assume 100s of rows and 10 columns) which needs to be exported as a PDF report. In the mashup, the user has an option to select the duration for which the data in the table has to be displayed. The source for the data in the table is from a Json file from another system ( if it is relevant )
I have Created a PDF generation code in eclipse that creates a table with sample placeholder data. But I am unable to figure out how the table can be created dynamically based on the data in thingworx. For example, if the user selects report duration as two days, the PDF should contain rows for only two days of data. If the user selects 15days in mashup and click the button, then the report should have table amounting to data for 15days.
In short, the table structure should depend on the duration selected in Thingworx.
Apologies if this is a vague question, but any help/pointers will be greatly appreciated!
Thanks in advance
Solved! Go to Solution.
Hi @kkgooner.
There are some unknowns here but one way you could do this would be to store the data from the .json file in a stream which can be queried based on timestamps. If you don't want to store the data in ThingWorx, is there some way you can request only the data needed from the external system?
Regards.
--Sharon
Hi @kkgooner.
There are some unknowns here but one way you could do this would be to store the data from the .json file in a stream which can be queried based on timestamps. If you don't want to store the data in ThingWorx, is there some way you can request only the data needed from the external system?
Regards.
--Sharon
Hello Sharon,
Thanks for your response.
Regarding your possible solution where you have said that we can store the json data in a stream and then query it based on timestamps, can you confirm if you mean Thingworx value stream? Just asking because I have seen that it can be used for Time-series data, but need to explore on using it for my case here.
Hi @kkgooner.
Please review the information in the ThingWorx Help Center for understanding the differences between streams and value streams.
If you have further questions, please let us know.
Regards.
--Sharon
Hi @kkgooner.
If the previous response answered your question, please mark it as the Accepted Solution for the benefit of others on the community.
Regards.
--Sharon