Skip to main content
1-Visitor
September 20, 2016
Question

How to load data into a grid from file repository which contains an excel file?

  • September 20, 2016
  • 1 reply
  • 9363 views

Hi there...

I'm trying to get the excel file content from file repository and load it into gird.

I have tried a couple of services such as csv parsing and load text. While using csv parsing service, i'm getting the content but not able to load it into the grid.(I checked it in debug option)

I'm a beginner to this platform. It will be very helpful if i get some suggestions.

1 reply

1-Visitor
September 20, 2016

Actually there isn't any service to read XLS files, to read it out-of-the-box with TW, the file should be a CSV file or a simple TXT file.

1-Visitor
September 21, 2016

Hi Carles,

You're correct. I have also tried CSV file but not able to load the content to grid. I would like to explain the task that i'm doing.

1. I shall import any csv file to the file repository.

2. The path of the csv file shall be taken using **GetFileInfo** service.

3. Then, mapping the path from **GetFileInfo** service to **LoadText** service shall provide the csv content. (I have done till this)

4. Here's the final one...​ When I try to load the content, the service throws an exception saying "Datashape must be specified". If I know the content of the table, I can create DataShape for that.(Please correct me if i'm wrong) But in my case, i don't know about the content and want to load it to grid.

Will rephrase if this is not clear.

Thanks.

1-Visitor
September 21, 2016

Hi,

Step 4. If you don't know the format of CSV file you can't use CSVParserFunctions, as they expect that you know the format before and you pass it as a DataShape.

If you need to load a free format CSV file, then you will need to use FIleRepository.LoadText({ path: }) service and parse the file by hand and then build the Infotable. Another option can be to Build your own extension using some powerful CSV java parser library.

Best Regards,

Carles.