I have a excel file which is contain a set of data. In Column C has department name. Now i need to filter each department wise and copy that data and need to send as an excel attachment.
Note : Department May increase or decrease based on the data pulled. But i need to send the mail only for available department in the Column C.
UniqueDept=(from dr as datarow in dt select dr.item("Department")).distinct()
For each item in UniqueDept
NewDtforDepartment=(from dr as datarow in dt where dr.item("Department") select dr).copytodatatable
You could try the following:
Use the ‘Read Range’ Activity in ‘Excel Application Scope’
Get unique Departments:
MyDTDepartments = MyDT.DefaultView.ToTable(True,“Departments”)
Loop through this data table using a ‘for each row’ activity
Create new excel files based on the filtered data
Is it clear for you?
Please let me know if you have any questions.
Thank you Buddy. I will try this and keep you posted.
Can you please explain the code how it will work.
UniqueDept=(from dr as datarow in dt select dr.item(“Department”)).distinct()
i am little confused on this.
Very glad I could help you, please like my post, it helps me.
Try it and let me know if you enconter any issues or it worked as you wanted.
This will pick unique references from your datatable to a generic collection.
Second line of code where we have used for each
It will filter datatable for each unique reference and copy it into a new datatable.
If you can provide a dummy excel, I ll share the screenshot for your ref.
Please see the attached dummy data. I need to filter the department. And send the data.(just like copy and paste in new excel and save the data based on department name. Kindly assist me.Department.xlsx (545.8 KB) Main.xaml (9.8 KB)
I have Tried but it was fail.Please see the attached dummy data. I need to filter the department. And send the data.(just like copy and paste in new excel and save the data based on department name. Kindly assist meDepartment.xlsx (545.8 KB) Main.xaml (9.8 KB)
Thank you.i have run the project that you have attached. But it was not running currently. i am getting error in write range activitie.
Note - i have updated all details in the send outlook activities.
@jais1609 What was your error message ?
This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.