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

Community Tip - Stay updated on what is happening on the PTC Community by subscribing to PTC Community Announcements. X

exporting multiple grid data using single export widget

svisveswaraiya
17-Peridot

exporting multiple grid data using single export widget

Hi,

Is it possible to bind service of multiple grids to a single export widget in a single mashup?

 

Thanks,

Shalini V.

ACCEPTED SOLUTION

Accepted Solutions

Hello Shalini,

 

I suppose it might depend on the export format you're looking for. One way is to use a service which returns an infotable of infotables. The dataExport widget can receive an infotable of infotables from that service and it will export that in a JSON format. Please see the attached ZIP file for an example using a mashup called footwearMash. The service which returns an infotable of infotables is Things["footwearHelper"].runExports, it is included in the ZIP file and also below is a code listing.

 

Best regards, Tanveer.

 

++++++++++++++++++++++++++++++++++++++

var salesByRegion = Things["salesByRegion"].GetDataTableEntries({
maxItems: undefined /* NUMBER */
});

var storeDetails = Things["storeDetails"].GetDataTableEntries({
maxItems: undefined /* NUMBER */
});

var params = {
infoTableName : "InfoTable",
dataShapeName : "infotableOfInfotablesDS"
};

var result = Resources["InfoTableFunctions"].CreateInfoTableFromDataShape(params);

// infotableOfInfotablesDS entry object
var newEntry = new Object();
newEntry.data = salesByRegion; // INFOTABLE
result.AddRow(newEntry);
newEntry.data = storeDetails; // INFOTABLE
result.AddRow(newEntry);

 

View solution in original post

2 REPLIES 2

Hello Shalini,

 

I suppose it might depend on the export format you're looking for. One way is to use a service which returns an infotable of infotables. The dataExport widget can receive an infotable of infotables from that service and it will export that in a JSON format. Please see the attached ZIP file for an example using a mashup called footwearMash. The service which returns an infotable of infotables is Things["footwearHelper"].runExports, it is included in the ZIP file and also below is a code listing.

 

Best regards, Tanveer.

 

++++++++++++++++++++++++++++++++++++++

var salesByRegion = Things["salesByRegion"].GetDataTableEntries({
maxItems: undefined /* NUMBER */
});

var storeDetails = Things["storeDetails"].GetDataTableEntries({
maxItems: undefined /* NUMBER */
});

var params = {
infoTableName : "InfoTable",
dataShapeName : "infotableOfInfotablesDS"
};

var result = Resources["InfoTableFunctions"].CreateInfoTableFromDataShape(params);

// infotableOfInfotablesDS entry object
var newEntry = new Object();
newEntry.data = salesByRegion; // INFOTABLE
result.AddRow(newEntry);
newEntry.data = storeDetails; // INFOTABLE
result.AddRow(newEntry);

 

Hi @svisveswaraiya.

 

If the previous response answered your question, please mark it as the Accepted Solution for the benefit of others with the same question.

 

Regards.

 

--Sharon

Announcements


Top Tags