Solved

read data and convert to pdf and send via mail

Posted on 2014-02-15
4
516 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

Enabling OSINT in Activity Based Intelligence

Activity based intelligence (ABI) requires access to all available sources of data. Recorded Future allows analysts to observe structured data on the open, deep, and dark web.

Join & Write a Comment

Problem Hi all,    While many today have fast Internet connection, there are many still who do not, or are connecting through devices with a slower connect, so light web pages and fast load times are still popular.    If your ASP.NET page …
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…
This video gives you a great overview about bandwidth monitoring with SNMP and WMI with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're looking for how to monitor bandwidth using netflow or packet s…
In this tutorial you'll learn about bandwidth monitoring with flows and packet sniffing with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're interested in additional methods for monitoring bandwidt…

762 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

20 Experts available now in Live!

Get 1:1 Help Now