Author Topic: Copy display data from DataGridView to Excel using EPPLUS  (Read 1790 times)

bachphi

  • Hero Member
  • *****
  • Posts: 671
    • View Profile
Copy display data from DataGridView to Excel using EPPLUS
« on: November 29, 2020, 09:58:27 AM »
I have a Datagridview that display data from a SQL query. Noted that , the dgv. have some hidden columns [visible=false]. The hidden columns are for higher level access. I want to copy the display data to excel using EPPLUS.

I was able to copy/paste to Excel using Microsoft.Office.Interop. But this approach require Excel installed at the target.  I prefer to use EPPLUS. EPPLUS do not seem to have copy/paste.

With EPPLUS, I can get ALL data[including hidden columns] from the dgv. then remove the unwanted columns.
It would be better if I can get only display data in one shot.

Any ideas?  Thanks.
« Last Edit: November 29, 2020, 10:11:27 AM by bachphi »
===================================================
This is NOT alt.read.my.mind.
No such thing is sh^t-for-brains unless you are posting to alt.read.my.mind.
===================================================