Solved

read data and convert to pdf and send via mail

Posted on 2014-02-15
4
520 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
4 Comments
 
LVL 16

Assisted Solution

by:Surendra Nath
Surendra Nath earned 250 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 200 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 50 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

3 Use Cases for Connected Systems

Our Dev teams are like yours. They’re continually cranking out code for new features/bugs fixes, testing, deploying, testing some more, responding to production monitoring events and more. It’s complex. So, we thought you’d like to see what’s working for us.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Icons and Colors for Terms 3 24
Split in Javascript 5 31
Visual Studio 2015 Source Code Control 10 38
Facial recognition to look through the whole database for a person 3 44
ASP.Net to Oracle Connectivity Recently I had to develop an ASP.NET application connecting to an Oracle database.As I am doing it first time ,I had to solve several problems. This article will help to such developers  to develop an ASP.NET client…
International Data Corporation (IDC) prognosticates that before the current the year gets over disbursing on IT framework products to be sent in cloud environs will be $37.1B.
Windows 10 is mostly good. However the one thing that annoys me is how many clicks you have to do to dial a VPN connection. You have to go to settings from the start menu, (2 clicks), Network and Internet (1 click), Click VPN (another click) then fi…
Sending a Secure fax is easy with eFax Corporate (http://www.enterprise.efax.com). First, just open a new email message. In the To field, type your recipient's fax number @efaxsend.com. You can even send a secure international fax — just include t…

863 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

Need Help in Real-Time?

Connect with top rated Experts

23 Experts available now in Live!

Get 1:1 Help Now