Click here to Skip to main content
15,888,116 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
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.
Posted

1 solution

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.
 
Share this answer
 
Comments
Wendelius 9-May-12 15:51pm    
Good advice, 5.
archies_gall 24-Jul-12 6:11am    
Thank you for the solution. I implemented the same.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900