Click here to Skip to main content
15,889,176 members
Please Sign up or sign in to vote.
1.00/5 (2 votes)
See more:
So, basically i m working on this project which i have to submit 2mrw. I have created a form and the user enters details in the form. My goal is that i am going to have this button which is called View data in Pdf format. The user then decides to save it wherever he wants to. Please please please please help me. I have no clue how to do it?
Posted
Comments
Maciej Los 2-Jun-14 12:04pm    
What have you tried? Where are you stuck?
Surajit Das 2-Jun-14 12:25pm    
I have only created the form with all the relevant details. I have no clue as to how to even start converting the data in pdf format.
Dave Kreskowiak 2-Jun-14 12:39pm    
Write code to print what you want like you were printing to any other printer.
Blutfaust 2-Jun-14 14:26pm    
So, if you have to submit your homework tomorrow why didn't you start earlier with research?

There are lots and lots of ways to do this. As you can see if you google[^] the issue.

There are many third party components you could try.
iTextSharp[^]
PDFSharp[^]
SharpPDF[^]

Those are a few I found on google.

The way that I've done it in the past is to create a CrystalReport. You design the report and then in your program you can pass it data. You can use a Crystal Report Viewer object to print preview or whatever, but the key is that you can export the report into a PDF. It's very basic and limited. You can't set certain properties while exporting it or use security on the PDF. But you can get the basic report in the format you want. Then you could use one of the third party libraries mentioned above (I've used PDFsharp) to add security or make other settings changes.

Hope this helps.
 
Share this answer
 
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900