Saving Table not working

morpheus93

Client
Регистрация
25.01.2012
Сообщения
1 038
Благодарностей
237
Баллы
63
Hi,

just try to save downloaded emails as an xlsx Excel table. But everytime the output Excel-file is messed up (many of columns in PMs "table viewer" and corrupted output excel-file). But when I parse the same data without saving the table, all looks fine in the integrated "table viewer".

But I need the output saved in an Excel viewable format, so that I can open it with.

The code I used:

Tuple<string, string, string, string>[] allMails;
allMails = ZennoPoster.BulkMailDownload(project.Variables["Email"].Value, project.Variables["Pass"].Value, lastHours: 24, proxyString: "socks5://127.0.0.1:1080");
// loop fo all messages
foreach(Tuple<string, string, string, string> tuple in allMails)
{
// adding messages to the table called Tabl1
// tuple.Item1 - sibject, tuple.Item2 - from, tuple.Item3 - html message, tuple.Item4 - text message
List<string> tmp = new List<string>();
tmp.Add(tuple.Item1);
tmp.Add(tuple.Item2);
tmp.Add(tuple.Item3);
tmp.Add(tuple.Item4);
project.Tables["ReceivedEmails"].AddRow(tmp);

}

Maybe it's because of to the "List<string>" that combines an list with different items in one line to an excel row and maybe in this process something gets messed up?
Is there an alternative code-snippet to save it to an working excel file?

Thank you!
 

VladZen

Administrator
Команда форума
Регистрация
05.11.2014
Сообщения
22 218
Благодарностей
5 843
Баллы
113
Why don't you save table to file using standart actions? Operations with Table>Save to File ?
 

Кто просматривает тему: (Всего: 1, Пользователи: 0, Гости: 1)