Writing data to excel


This is the last step which I have used for writing data to excel I have used for each activity as I have three invoices of different formats to be processed. In case of the first invoice all the extracted data is written to excel as required but for second invoice the excel sheet shows only some fields. So this is my issue

@seemajethe02 I guess your sheet name should be made dynamic. Use tables.TableName as your Sheet value and check what is the Output

1 Like

You mean if I am processing three invoices then i should get three excel sheets as output

@seemajethe02 I mean I am not sure, but since you’re using a For Each and you’re not using a Dynamic Sheet, It would mean that the Sheet1 is getting overwritten by the last Datatable value.
Hence if you would provide a dynamic sheet name values, we can understand how many tables does the dataset have.

or we can just use a message box with value as DataSet.Tables.Count as the value to know the Count of the tables present in it.

In any case I think you need to make the Sheet names dynamic

How to create dynamic sheet names in this case ? Will You please help me with this.

I have four tables in my dataset

I had already mentioned :sweat_smile: , you can use tables.TableName in Write Range Activity instead of Sheet1

I am getting the output but all extracted data in different sheets. can I get all data in one sheet?

@seemajethe02 It is possible depending on the Schema of the datatable and how you want all the data to be appeared in a Single Sheet.

If you can provide the Screenshots of the Sheets that you want to combine and the Screenshot of How you want it to appear in a Single Sheet, we can see if that is possible.

These are the screenshots of the excel sheets form the 4 datatables. And I want all this data in one sheet.

@seemajethe02 I think you would need only two Sheets to be combined i.e the Simple fields Sheet and the Details Sheet right ?
Because the other two are just the Copy of those :sweat_smile:

and Can you Show the expected output after combining, How you would need them?

This is the expected output which I need after combining two sheets

@seemajethe02 Since the Schema is not Matching, It might be a bit difficult to do that :sweat_smile: . I’ll try and check if I can make it work.

ok thanks

The expected output can also be in this way

Is it so that always I will get four data tables in dataset ?

@seemajethe02 It depends on the data that you extract. In your case, you are extracting Individual Values and the Table values. Hence the Extractor Classifies into two Sheets, Also it adds an Extra Sheet for each, as you can see there is “Simple Fields” and “Simple Fields - Formatted”. The Formatted sheet is the extra sheet which you might not need, but it may contain some extra details related to the format of data.

ok thanks. While processing .png file using document processing I am getting an error as Index scope out of array bounds So I just wanted to know which array has elements grater than its size?

can u please help me with this?

@seemajethe02 I guess that would be the classificationresults(0). It is better if you first check if there are any Classification Results available and then proceed to do further operations. Please tag me if you have any more questions, I can’t get to know If there are any questions asked by you in this topic if not tagged or replied :sweat_smile:

but how will I check if there are any classification results available?