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

Is possible to download production reports from thingworx in vuforia view thorugh file widget?

Suraj_Patil
15-Moonstone

Is possible to download production reports from thingworx in vuforia view thorugh file widget?

HI all,

 

I am working on USECASE where customers wants to download the production Reports in vuforia view(Tablet) which are available on thingworx platform.

I know about vuforia studio and thingworx integration which is already done. here we are pushing the data from vuforia view AR experience while doing assembly of machine. But at the end of day we want production reports in form excel download on view. 

Can anyone help me in this to achieve. or anyone has already tried please guide for this output.

 

thanks,

Suraj Patil

1 ACCEPTED SOLUTION

Accepted Solutions

Hi @Suraj_Patil ,

I think your question contains a few points , so possibly as timely reasons, we can split in some subpoints and handle each answer in separate posts (inside this topic)

So here I want to discuss the report itself. You mentioned that it outputs  csv file. So believe when the user  will  complete the required task  after  work in Thingworx (mashup) then the user  can generate the report and export it to csv. So then in Vuforia Studio when you want simple to display the csv file which is already generated then you can save it to Thingworx File repository and form there load it to Vuforia Studio via LoadText file repository service and then read it via JavaScript where you can parse the csv format to different values

But I think you intention is different - you want to generate the report in Vuforia Studio . This means in this case it will not make sense to load and parse a csv file.

So what you need is to display the data from Thingworx. This is too general , but without knowledge of the TWX data I have no idea how to display it. When it is a table then you can use a repeater or dataGrid widgets (what unfortunately is not working in the current  version but is already  fixed , please, see https://community.ptc.com/t5/Vuforia-Studio/Data-Grid-Widget-Appears-to-not-be-working/td-p/869073 ) . alternatively  you can use gauge , label etc... widget which will display the TWX data (binding in Expernal data or call of twx service)

You can link the same Thingworx services what you use already in the Thingworx mashup (So in your case the Experience Project will try to implement an UI which corresponds to your mashup. In Studio External data services , you can call your TWX service which will create the end report , - so the report is created then in Thingworx and you can then export it from there , but as mentioned you can call the twx services form Vuforia Studio.

In Studio UI you can also perform some user permissions checks by calling TWX resources ->CurrentSessionInfo.GetCurrentUser() to check the current user ,User Group checks and other admin services,  from TWX (referring to PTC Article https://www.ptc.com/en/support/article/cs306223 ) 

So the general call  of TWX service could be via binding to buttons and to data from the external area but also you can use JavaScript . Here is an example. When the service should retrieve data , because the call of the TWX service is asynchronous you need also to define a "<yourService>-complet" event)

Example:

 

$scope.testTwxService=function(){
   var TWXmodelID = 'CurrentSessionInfo';
   var serviceName = 'GetActiveUsers';
    var data = {};// this is json but here is empty , no data will send
   twx.app.fn.triggerDataService(TWXmodelID, serviceName, data);
};
//handle the retrived data
$scope.$root.$on('GetActiveUsers-complete', function(event, args) { 
  console.log("GetActiveUsers-complete event");
  console.log("name="+event.name)
let retObjData=  args.data;
console.log("obj---> returned")
console.warn(retObjData);

})

 

View solution in original post

3 REPLIES 3

Hi @Suraj_Patil,

I saw this question whiteout any answers. But possibly there is need of further  clarification if issue is still relevant (possibly already obsolete)

I have no knowledge about the TWX production reports. How this provides the data - is this a service which returns infotable data or is this a document type e.g. csv data format. Depending on this how the data is provided we could use this service in the external data section and bind this to some widget like repeater or dataGrid or respectively load this data via e.g. LoadBinaray, LoadJson etc. services to Vuforia Studio memory variable and and try to display this is in Studio. Currently we could not download any object to local memory in view. So when you change something  in view app (UI) then you need to resend the data back to Thingworx and try from a widget to create /download the data from a TWX mashup.

 

ill elaborate the problem statement here.

 

we can generate reports in CSV on thingworx mashup.

now same reports i want to generate on vuforia view app.

 

suppose in AR experience, the requirement is we need to enter our login credentials before anyone to start the Experience. 

now here whatever credentials are entered suppose e.g. name of person, like this a lot of people are simultaneously working on various experience.

so at the end of shift i want generate the report about how many people are actually worked on AR experience (in CSV).

while also working on experience, people also entering some comments, tolerance  value or scanning QR code in experience.

so at the end of shift all this comments or data entered in experience has to be involved in reports generated in vuforia view.

 

so here what i  pushed the all data in thingworx successfully with add stream entry service from vuforia view.

and i successfully fetched the data from thingworx to vuforia view (in grid )as well.

but i want to write all this data in csv in vuforia view.

 

so i hope this explains my problem statement and what i tried to with AR IOT integration here.

 

Hi @Suraj_Patil ,

I think your question contains a few points , so possibly as timely reasons, we can split in some subpoints and handle each answer in separate posts (inside this topic)

So here I want to discuss the report itself. You mentioned that it outputs  csv file. So believe when the user  will  complete the required task  after  work in Thingworx (mashup) then the user  can generate the report and export it to csv. So then in Vuforia Studio when you want simple to display the csv file which is already generated then you can save it to Thingworx File repository and form there load it to Vuforia Studio via LoadText file repository service and then read it via JavaScript where you can parse the csv format to different values

But I think you intention is different - you want to generate the report in Vuforia Studio . This means in this case it will not make sense to load and parse a csv file.

So what you need is to display the data from Thingworx. This is too general , but without knowledge of the TWX data I have no idea how to display it. When it is a table then you can use a repeater or dataGrid widgets (what unfortunately is not working in the current  version but is already  fixed , please, see https://community.ptc.com/t5/Vuforia-Studio/Data-Grid-Widget-Appears-to-not-be-working/td-p/869073 ) . alternatively  you can use gauge , label etc... widget which will display the TWX data (binding in Expernal data or call of twx service)

You can link the same Thingworx services what you use already in the Thingworx mashup (So in your case the Experience Project will try to implement an UI which corresponds to your mashup. In Studio External data services , you can call your TWX service which will create the end report , - so the report is created then in Thingworx and you can then export it from there , but as mentioned you can call the twx services form Vuforia Studio.

In Studio UI you can also perform some user permissions checks by calling TWX resources ->CurrentSessionInfo.GetCurrentUser() to check the current user ,User Group checks and other admin services,  from TWX (referring to PTC Article https://www.ptc.com/en/support/article/cs306223 ) 

So the general call  of TWX service could be via binding to buttons and to data from the external area but also you can use JavaScript . Here is an example. When the service should retrieve data , because the call of the TWX service is asynchronous you need also to define a "<yourService>-complet" event)

Example:

 

$scope.testTwxService=function(){
   var TWXmodelID = 'CurrentSessionInfo';
   var serviceName = 'GetActiveUsers';
    var data = {};// this is json but here is empty , no data will send
   twx.app.fn.triggerDataService(TWXmodelID, serviceName, data);
};
//handle the retrived data
$scope.$root.$on('GetActiveUsers-complete', function(event, args) { 
  console.log("GetActiveUsers-complete event");
  console.log("name="+event.name)
let retObjData=  args.data;
console.log("obj---> returned")
console.warn(retObjData);

})

 

Top Tags