I use the excel activity “read range” to read data from a excel file, the data is storaged in a datatable variable, then I filter the data with “filter data table”. but it doesn’t work, the result is empty.
Strangely, I use another acitvity “system-file-read range workbook” to read same data from the excel, and filter. It succeeded.
what’s the different of “excel-read range” and “file-read range workbook”? Thanks.
I think the function of the “read range” component is fine as it reads data from Excel normally. But why did the filtering fail?
Is there some difference in the datatable after read range? I didn’t see any differences in the content display from the watching view.
thanks. the data type is different with the two activity. one is “string”, another is “object”
I think it’s maybe has different feature packages and different technical implementations, so the functional components cannot be mixed to use. That is, the interface standards for component functions are different.
With string datatype ypu cannot use <= to filter…that is the reason it is failing
Genwrally when read as workbook it reads the backend value
Cna you please try changing the reqd formatting to rawvalue and check if that works…mostly that should be working and please remove visible rows check box from read range…
And yes to avoid such differences we sometimes go with linq depending on how the data would be coming…as sometimes there might be empty cells as well in place of 0 and then when read using read range because of empty cell the column type might be considered as string instead of object or double
And for the same in linq we can add a little caution as well to check for empty or parse cdbl before trying to convert and check
arrDr=dt.AsEnumerable.Where(Function(x) Double.TryParse(x("IWH Support Time(H)").ToString,0) AndAlso CDbl(x("IWH Support Time(H)").ToString)<=2.2).ToArray()
When you are using the excel activities the Microsoft Excel application has to be installed in your system, then it works.
If the Excel application is not installed in your system, make sure to install to use the Excel activities.
If you don’t want to install the Excel application then you can use the workbook activities, it doesn’t need excel application installed in your system.