Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

Export data from ASP.Net/C# application to a .pdf file

Posted on 2014-02-07
2
Medium Priority
?
870 Views
Last Modified: 2014-02-09
Is there a way to export data from a web page in asp.net to a .pdf file? I hope to do this without any 3rd party tools. I am working with VS 2012 and SQL Server 2008. The data all resides in SQL Server, but users will be viewing selected data in an ASP.Net web page and then exporting to a .pdf file. Can this be done? Thanks.
0
Comment
Question by:dodgerfan
2 Comments
 
LVL 75

Accepted Solution

by:
käµfm³d   👽 earned 2000 total points
ID: 39842287
I hope to do this without any 3rd party tools.
Sure you can do this without 3rd party tools, if you have the time to implement the PDF specification in your C# code   ; )

Since the data resides in SQL Server, you might consider using SQL Server Reporting Services  (SSRS) to generate a report, which can be exported to various formats including PDF and Excel. I think the code to do such would be dependent on what your SSRS setup provides. Our report server offers web service endpoints that we can call; in searching around the 'Net, it seems that invoke a report using proxy classes also.

Outside of SSRS, you might consider using something like iTextSharp. I have not used it myself, but I know that it's a popular library for working with PDF documents. You could create a fillable PDF template (using Adobe, if you have it available), and then use iTextSharp to fill in each field.
0
 

Author Closing Comment

by:dodgerfan
ID: 39845428
Ok, thanks for the help. I'll take a look at both suggestions.
0

Featured Post

Veeam Disaster Recovery in Microsoft Azure

Veeam PN for Microsoft Azure is a FREE solution designed to simplify and automate the setup of a DR site in Microsoft Azure using lightweight software-defined networking. It reduces the complexity of VPN deployments and is designed for businesses of ALL sizes.

Question has a verified solution.

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

An alternative to the "For XML" way of pivoting and concatenating result sets into strings, and an easy introduction to "common table expressions" (CTEs). Being someone who is always looking for alternatives to "work your data", I came across this …
This month, Experts Exchange sat down with resident SQL expert, Jim Horn, for an in-depth look into the makings of a successful career in SQL.
Via a live example, show how to backup a database, simulate a failure backup the tail of the database transaction log and perform the restore.
Viewers will learn how to use the UPDATE and DELETE statements to change or remove existing data from their tables. Make a table: Update a specific column given a specific row using the UPDATE statement: Remove a set of values using the DELETE s…
Suggested Courses

810 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