AdvancedHMI Software

General Category => Open Discussion => Topic started by: bachphi on November 29, 2020, 09:58:27 AM

Title: Copy display data from DataGridView to Excel using EPPLUS
Post by: bachphi 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.