Link to home
Start Free TrialLog in
Avatar of zimmer9
zimmer9Flag for United States of America

asked on

I'm trying to export a stored procedure to a PDF file, how to resolve attempt to open PDF file, I get error: Adobe Reader could not open 'xxx.pdf' because it is either not a supported file ...?

I am developing my first ASP.NET C# application using VS2010.
I try to write a stored procedure to a PDF file but when I open the PDF file,
I get the following error:

Adobe Reader
Adobe Reader could not open "Contacts[1].pdf because it is either not a supported file
or because the file has been damaged (for example, it was sent as an email attachment and wasn't correctly decoded).

My code is in the attached file:
PDF-Code.txt
ASKER CERTIFIED SOLUTION
Avatar of Chinmay Patel
Chinmay Patel
Flag of India image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
hi,
chinmay is right the pdf is a different game.you cannot directly generate a pdf by changing the content type of the file name, for this purpose you need a pdf generating engines such as itextsharp.

see the below links which may help you out.
.pdf generator in .NET - Dynamically generate .pdf in ASP.NET
Exporting a DataTable to PDF
Convert Datatable to PDF
hope this helps.
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial