Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

read data and convert to pdf and send via mail

Posted on 2014-02-15
4
Medium Priority
?
527 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

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

More often than not, we developers are confronted with a need: a need to make some kind of magic happen via code. Whether it is for a client, for the boss, or for our own personal projects, the need must be satisfied. Most of the time, the Framework…
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…
In this video, Percona Solution Engineer Rick Golba discuss how (and why) you implement high availability in a database environment. To discuss how Percona Consulting can help with your design and architecture needs for your database and infrastr…
This lesson discusses how to use a Mainform + Subforms in Microsoft Access to find and enter data for payments on orders. The sample data comes from a custom shop that builds and sells movable storage structures that are delivered to your property. …

636 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