Community Tip - Stay updated on what is happening on the PTC Community by subscribing to PTC Community Announcements. X
Hello,
I'm using Thingworx 9.0 version and I want to generate pdf file. I'll refer this post and I import an pdf extension in Thingworx and follow all steps with give an all inputs to parameter But I'm getting an error ,when I click on button. I'll search on this error and refer this post but it is not working so Please refer the below attachment and suggest
1) How Do I generate pdf and excel file when I click on create PDF button?? OR
2) Is their another way to generate pdf file by taking screenshot of any mashup and generating an pdf or excel file
Thanks in advance
Solved! Go to Solution.
Hi @RM12
You can use write csv function from snippet. See the below example:
let params1 = {
path: "/abc.csv" /* STRING */,
data: result /* INFOTABLE */,
fileRepository: "SystemRepository" /* THINGNAME */,
withHeader: true /* BOOLEAN */
};
// no return
Resources["CSVParserFunctions"].WriteCSVFile(params1);
Pass result of any service which in the result variable which you want to write in csv.
Regards,
Mohit
Hi @RM12.
The PDF extension that was previously found on the Marketplace is not compatible with 9.0. Currently there is no option to generate PDF files in ThingWorx. However, there are requests for this on the ThingWorx Ideas forum. I encourage you to vote for these to improve the possibility they will be included in future releases.
For Excel, you can install the CSV Parser extension available on the PTC Download page:
Regards.
--Sharon
You can CSV as well using the data export widget
Also you could write a file to the file repository directly in the back end.
Rest api also supports text/csv return
Thanks for your reply ,Can you please explain in detail how do I used CSV parse function for generating report file (CSV)???
Hi @RM12
You can use write csv function from snippet. See the below example:
let params1 = {
path: "/abc.csv" /* STRING */,
data: result /* INFOTABLE */,
fileRepository: "SystemRepository" /* THINGNAME */,
withHeader: true /* BOOLEAN */
};
// no return
Resources["CSVParserFunctions"].WriteCSVFile(params1);
Pass result of any service which in the result variable which you want to write in csv.
Regards,
Mohit