?
Solved

read data and convert to pdf and send via mail

Posted on 2014-02-15
4
Medium Priority
?
525 Views
Last Modified: 2014-02-25
HI,

I am doing one functionality,its look like that i have to read some data from sql server DB ,read that data and convert in PDF file once pdf create send to via mail in one shot.

code in asp.net and c#

could you please provide the guidance or code how do i perform it in one function.

db--->read data--->convert data as a report in pdf--->send that pdf to client via mail
Thanks
0
Comment
Question by:nicemanish
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
4 Comments
 
LVL 16

Assisted Solution

by:Surendra Nath
Surendra Nath earned 750 total points
ID: 39861543
step 1: Connecting to Database and reading data from DB

you have to use a odbc or SQLconnection to get the data from DB, you can follow the below example for the same.
http://www.dotnetperls.com/sqldatareader

Step 2: write the data to a PDF file...

.NET natively does not support writing to a pdf file, you have to use a third party library which are publicly available.

The below is a library which can help you in writing to pdf file... how to use it and all with examples are also given in the same url.

http://www.codeproject.com/Articles/570682/PDF-File-Writer-Csharp-Class-Library

Step 3: Send that via e-mail as an attachement.

Follow the below link on how to send that using an e-mail
http://www.mattvanandel.com/842/c-sending-an-email-with-an-attachment-via-form/
0
 
LVL 16

Assisted Solution

by:Easwaran Paramasivam
Easwaran Paramasivam earned 600 total points
ID: 39861564
Yes. It is possible. Instead of file content save file physical file path (it could be network path).

Ensure that you have the read/write permission to the shared path.


Write code to attach the file and send as email. Refer below one for that:

http://www.codeproject.com/Questions/634878/Send-email-with-Attachment-in-Csharp
0
 

Accepted Solution

by:
mokaid83 earned 150 total points
ID: 39861605
well . if you want this could be done using php
you can check the following links , i used these libraries in many projects

PHPMAILER
https://github.com/Synchro/PHPMailer


PDF
http://www.fpdf.org/

very simple and easy to use
if you need further help .. just let me know
0
 

Author Closing Comment

by:nicemanish
ID: 39885385
good
0

Featured Post

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Wouldn’t it be nice if you could test whether an element is contained in an array by using a Contains method just like the one available on List objects? Wouldn’t it be good if you could write code like this? (CODE) In .NET 3.5, this is possible…
Real-time is more about the business, not the technology. In day-to-day life, to make real-time decisions like buying or investing, business needs the latest information(e.g. Gold Rate/Stock Rate). Unlike traditional days, you need not wait for a fe…
This is my first video review of Microsoft Bookings, I will be doing a part two with a bit more information, but wanted to get this out to you folks.
In this video, Percona Solution Engineer Dimitri Vanoverbeke discusses why you want to use at least three nodes in a database cluster. To discuss how Percona Consulting can help with your design and architecture needs for your database and infras…
Suggested Courses

770 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question