在电子邮件正文中以表格形式显示数据 [英] To display data in tabular form in the body of email

查看:1157
本文介绍了在电子邮件正文中以表格形式显示数据的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

团队,

我必须从具有多列的excel文件中读取数据...并且必须从该excel文件中提取一列(应用程序名称)的数据,并且必须找到应用程序名称的数量(例如:A-5,B- 6).一个应用程序在excel中出现了5次,B应用程序在excel中出现了6次.

读取Excel后生成的电子邮件正文中必须以表格形式显示.

喜欢:
-----------------
|应用程序|计数|
-----------------
| A | 5 |
-----------------
| B | 6 |
------------------

与上面类似.


请帮助我..因为我是C#的新手,并且只有基本知识.

预先表示感谢.

Hi Team,

I have to read data from a excel file which has multiple columns... and from that excel i have to extract data of one column(application name) and have to find the count of application name( eg: A-5 , B-6). A application has appeared 5times in an excel, B application has appeared 6 times in excel.

This has to be displayed in tabular form in the body of email generated after it reads the excel.

Like:
-----------------
|Application|Count|
-----------------
|A | 5 |
-----------------
|B | 6 |
------------------

something similar to above.


Please help me.. as i am new to C# and have only basic idea.

Thanks in advance.

推荐答案

从您的问题中可以看到,文本格式很可能会破坏纯文本电子邮件中的任何尝试. (大多数电子邮件客户端不使用固定间距字体,在纯文本电子邮件中,您无法指定标记来更改字体.)

因此,您有两种选择:

  • 使用HTML邮件,并构造一个真实的表(带有< table>< tr>< td>等)
  • 更改格式,以使其在纯文本消息中也能很好地工作"A:(tab)5次出现(换行)B:(tab)6次出现".
  • 使用StringBuilder构造文本,两种方式都可以.
As you can see from looking at your question, text formatting is likely to screw up any attempt to do this in a plain text email. (Most email clients don''t use a fixed pitch font and, in plain text emails, you can''t specify markup to change that.)

So you have two options:

  • Use HTML mail, and construct a genuine table (with <table><tr><td> etc)
  • Change your format so that it works well in a plain text message, perhaps "A:(tab)5 occurrences(newline)B:(tab)6 occurrences".
  • Use a StringBuilder to construct the text, either way.


这篇关于在电子邮件正文中以表格形式显示数据的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆