@lakshman @aman.kumar.monga.09
The above expression is working fine if you want to fetch selected rows from the input excel file.
My issue is that…I want to keep only the selected header column from my input excel file and data based on only my if condition. My program was working if i use the method DefaultView.totable(true, “column1”, “column2”). It returns the selected columns but all the records of input excel file as well and i want only those records which satisfy the if condition only. If you run my above program you see that the output.xlsx file is generated with all the records that are in input excel and also records which comes from the if condition.

Refer My Screenshots of input and output fie…I want only 2 records in the output file not all the records.
I also used “inputDT.clone” method, it works but all columns are returned and i want selected columns only.