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

Community Tip - Did you know you can set a signature that will be added to all your posts? Set it here! X

Download created file on Client UI from any location

VK_11755221
2-Explorer

Download created file on Client UI from any location

Version: Windchill 12.1

 

Use Case: I have one action on Details page action set of part and on click of that action I am creating one excel file with few custom data in windchill temp location. Now requirement is it should get downloaded on client UI on click of that custom action. So need help with line of code to download created file from particular location.


Description:

I have one action on Details page action set of part and on click of that action I am creating one excel file with few custom data in windchill temp location.

Now requirement is it should get downloaded on client UI on click of that custom action.

So need help with line of code to download created file from particular location.

2 REPLIES 2

FormResult result = new FormResult();
String filePath = "file path";
File file = new File(filePath);
URL localURL = NmObjectHelper.constructOutputURL(file, file.getName());
result.setForcedUrl(localURL.toString());
result.setURL(localURL.toString());
FeedbackMessage msg = new FeedbackMessage(FeedbackType.SUCCESS, Locale.CHINA, "Export Data", null, "Export Success");
result.addFeedbackMessage(msg);
result.setStatus(FormProcessingStatus.SUCCESS);
return result;

Hello @VK_11755221,

 

It looks like you have a response from a community member. If it helped to answer your question please mark the reply as the Accepted Solution. 

Of course, if you have more to share on your issue, please let the Community know so other community members can continue to help you.

Thanks,
Vivek N.
Community Moderation Team.

Announcements

Top Tags