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

Community Tip - Want the oppurtunity to discuss enhancements to PTC products? Join a working group! X

how to generate pdf or excel file in thingworx??

RM12
13-Aquamarine

how to generate pdf or excel file in thingworx??

 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

ACCEPTED SOLUTION

Accepted Solutions
mgoel
17-Peridot
(To:RM12)

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

View solution in original post

4 REPLIES 4
slangley
23-Emerald II
(To:RM12)

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

PaiChung
22-Sapphire I
(To:RM12)

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

RM12
13-Aquamarine
(To:PaiChung)

Thanks for your reply ,Can you please explain in detail how do I used CSV parse function for generating report file (CSV)???

mgoel
17-Peridot
(To:RM12)

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

Announcements


Top Tags