Query |
Response | |
I am working with default DataGridView, I load the data from datatable and exported same to Excel, but what if I want to export only selected columns to Excel for Ex. My DataTabke is having 20 Column, Now I want to give selection to User's hand that he/she can select the columns which they want to export I can do that by just loading the Titles in CheckListBox but after that How can I export only those columns which are selected?
Solution I found by myself
>I can copy the selected columns to new DataTable and Export New DataTable : Which I feel not good option.
Is there any direct way of doing it?
|
You can achieve your requirement by using TemplateMarkers in XlsIO. We have prepared a sample for this which can be downloaded from the following location.
Sample link:
To know more about TemplateMarkers, please refer the following UG documentation link for your reference.
UG Documentation link:
| |
I want to merge the cells to a specific number
For Example : This is what we do to merge the Cells
ws.Range("A1:AE1").Merge()
ws.Range("A1:AE1").Text = "Daily Report"
But as i asked in first question what if user is selecting 3 columns instead of 20 Columns.
Is ther any way I can merget the columns like ws.Range(1:30).Merge() ? Kind of option?
|
You can specify row and column to get specific range from worksheet. For example, if you want to merge range from 1st column to 30th column then you can get range using following code example.
Code snippet:
Kindly refer the below UG documentation to know more about accessing a cell or range in XlsIO. UG Documentation link: |
Hello, Can u help me provide for C# format? I want the user can choose which column he want to export freely too.. but in c# format ty
guys i just found out that we can use columnChooser, thanks
Hi Dhairya,
Thanks for sharing the solution. Please feel free to contact us if you need any further assistance.
Regards,
Ramya.