Skip to main content
1-Visitor
December 13, 2021
Solved

Multiple tabs in excel when export

  • December 13, 2021
  • 1 reply
  • 2740 views

Hi,

When we export data, is it possible to dynamically split rows and add them in multiple tabs? Eg: if there are total of 5 lakh rows, I wanted to split them 1 lakh rows in 1st tab and from 100001 to 2lakh rows in 2nd tab and likewise. Is it possible to achieve this use case in ThingWorx?

 

Thanks in advance,

Shalini V.

Best answer by PEHOWE

@svisveswaraiya_285745,

 

If you take the approach of loading the ThingWorx CSV Parser Extension, you can write your own service. Having the extension loaded will allow you to create a Service on a Thing. This service can be designed to meet your needs. 

 

From our conversation I would guess that you have an InfoTable which contains all the information you wish to export. The service would need to have some type of loop to work through the information and create a sub infotable which can then be passed to:

 

 

Resources["CSVParserFunctions"].WriteCSVFile(params);
 

This will create a file for that sub table. You will then need to loop and perform the next segment. 

 

Because you have created a unique service to generate the number of files you need. then the service can be activated by a single button push.

 

HTH

Pehowe

1 reply

17-Peridot
December 14, 2021

@svisvswarai,

The CSV file is defined to be a single Tab in an Excel file. There is no support for multiple tabs in the CSV file. The process you create to export the data from your instance can perform the export multiple times. Each export will create a different CSV file. These files can then be imported into different tabs in excel.

 

1-Visitor
December 14, 2021

Hi @PEHOWE ,

Thanks for your response. 

Could you please guide me how to export multiple times by splitting of data? The user will be clicking the export once and based on rows, can the files be exported multiple times?

PEHOWE17-PeridotAnswer
17-Peridot
December 15, 2021

@svisveswaraiya_285745,

 

If you take the approach of loading the ThingWorx CSV Parser Extension, you can write your own service. Having the extension loaded will allow you to create a Service on a Thing. This service can be designed to meet your needs. 

 

From our conversation I would guess that you have an InfoTable which contains all the information you wish to export. The service would need to have some type of loop to work through the information and create a sub infotable which can then be passed to:

 

 

Resources["CSVParserFunctions"].WriteCSVFile(params);
 

This will create a file for that sub table. You will then need to loop and perform the next segment. 

 

Because you have created a unique service to generate the number of files you need. then the service can be activated by a single button push.

 

HTH

Pehowe