Write Collection to excel file
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
27-09-19 01:23 PM
Hi all
I have a collection which I want to write to an excel file . Can someone provide me the C# code for the same along with the dll's? I am aware of the write collection feature, but I want to do it faster since my collection is quite large.
------------------------------
Prajjwal Rai
Application Engineer
Schneider Electric Private Limited
------------------------------
I have a collection which I want to write to an excel file . Can someone provide me the C# code for the same along with the dll's? I am aware of the write collection feature, but I want to do it faster since my collection is quite large.
------------------------------
Prajjwal Rai
Application Engineer
Schneider Electric Private Limited
------------------------------
3 REPLIES 3
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
01-10-19 09:21 PM
Copy whole xml and paste this as new page into Excel VBO (click after last tab and pick paste) - should be much faster that default, although behaves a bit different in some cases:
https://pastebin.com/4cm2J4A7
------------------------------
Andrey Kudinov
Project Manager
MobileTelesystems PJSC
Europe/Moscow
------------------------------
https://pastebin.com/4cm2J4A7
------------------------------
Andrey Kudinov
Project Manager
MobileTelesystems PJSC
Europe/Moscow
------------------------------
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
19-10-19 07:17 PM
Instead of using StringWriter it would be fastest to convert the BP Collection which is actually a System.DataTable into a 2D Array. Excel supports Setting a range equal to a 2d array in one write. This usually will take about 1-2 seconds total run time for a collection which is 100,000 Rows by 10 Columns.
------------------------------
Erin Connerley
Automation Consultant
Agilify Automation
America/Indiana/Indianapolis
------------------------------
------------------------------
Erin Connerley
Automation Consultant
Agilify Automation
America/Indiana/Indianapolis
------------------------------
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
20-10-19 06:09 PM
@ErinConnerley That is what it does.
StringWriter is there only to serialize a subcollection into a cell. It is hardly useful in practice (I did it for debug purposes originally), could be skipped instead.
------------------------------
Andrey Kudinov
Project Manager
MobileTelesystems PJSC
Europe/Moscow
------------------------------
StringWriter is there only to serialize a subcollection into a cell. It is hardly useful in practice (I did it for debug purposes originally), could be skipped instead.
------------------------------
Andrey Kudinov
Project Manager
MobileTelesystems PJSC
Europe/Moscow
------------------------------
