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

Community Tip - You can Bookmark boards, posts or articles that you'd like to access again easily! X

How to export mashup reports to PDF and Excel format?

Sheetal_sable
12-Amethyst

How to export mashup reports to PDF and Excel format?

Hi,

    I have created a mashup report and wanted to export mashup reports to PDF/Excel. How can I achieve this?

 

Thanks in Advance!!

 

Sheetal sable

 

9 REPLIES 9

@Sheetal_sable : Downlaod "PDF Extension" from PTC MarketPlace that will help you in generating PDF file from a specific mashup

Hi,

     I already imported the PDF extension in thingworx. But what i want is to have a button on mashup and which when clicked will generate pdf with data.

 

Thanks and regards,

Sheetal sable

@Sheetal_sable : what you can do is to have a button widget on mashup and use click event to call CreatePDF service coming from Resource_PDFExport

attached is the screenshot showing the mapping of parameters for createPDF service. you can directly put down the parameters at mashup level as shown in screenshot

 

like in my ex

my mashup shows data in grid, having textbox that is dragged to repeater widget.

 

if this resolves your problem then mark this as solution for documentation and benefits for others

Thanks

 

hi,

@rosharma  , Thanks for the reply. I have performed all the steps as you have mentioned. My pdf report is getting generated. But I am getting a blank pdf i.e data within grid is not displayed, only the empty grid is displayed.

 

In your example, you are displaying report on mashup load if I am not wrong, but in my case

I want to display report on clicking of button which takes parameter from textbox.

 

Note: see the attached sceenshots of my Mashup.

 

Could you please help me out how to display report on button click by taking parameter value from a textbox?

 

Thanks,

Sheetal Sable

@Sheetal_sable : I believe CreatePDF service from Resource_PDFExport (coming from extension) only generates the report of static data which is already visible over mashup. 

In your case since your mashup was not having any data when you executed CreatePDF service that's why your report doesn't show any data(createPDF service got executed before mashup is loaded with data). its better to have data first on mashup followed by creating the report.

 

Or if you want your data and report simultaneously then you need to timed it out the service execution over button clicks. (i.e put delay between two events - the one loading the data over mashup & other with generating of Report)

 

In my case i had data over mashup load , after that on button click event i am generating PDF. 

this is what i understand from your use case.

Thanks for the your kind reply.

But what problem i am facing is in create PDF service we need to specify Mashup name so whenever i am passing my runtime mashup name its generated my PDF with no data because data loading is done after click event on button so, is there any way to  generated PDF with data after click event if yes then what need to be  specify in  mashup parameter in create PDF service ?

 

Thanks a lot.

 

@Sheetal_sable : i am thinking in this way if we can achieve

 

See if you set the runtime mashup URL using session parameters/mashup parameter

there is a session tab over mashup (top right side)- there you have MashupName

will require a bit of concatenation on that using "mashup parameter " using Configure Mashup Parameters at mashup level -  this parameter will have static context like http://localhost/Thingworx/Runtime/index.html#mashup=

which is always going to be constant - then concatenate this URL like below

 

http://localhost/Thingworx/Runtime/index.html#mashup="REPLACE_HERE_WITH_MASHUPNAME_FROM_SESSIONVARIABLE"

hi,

How to bind static context in mashup parameter and also how to concatenate this with URL? Can You explain in detail? I am not able to get you point.

 

Thanks and Regards,

Sheetal Sable

@Sheetal_sable : i mean to say your serveraddress parameter would be fixed since it depends on mashup name & that would always going to be same.

so on this i have defined one "mashup parameter" string type named as serverurl - setting that value for this parameter as http://localhost/Thingworx/Runtime/index.html#mashup=mashupname

now bind this parameter to serveraddress .similarly you can define for other parameters as well.

 

also as said earlier the report gets created when createPDF service is called on an event( so the data which is already there on mashup will be printed in pdf file)

 

Thanks

Announcements


Top Tags