Sherrie Goh
Sherrie Goh

Reputation: 1

Print function in asp.net

I'm a beginner that just learn how to do coding and I happened to need a print function in my asp.net school project. (c#) is there anyone that can show me an example and guide me along? I'm currently using visual studio 2013 for my project. It's quite a trouble when the vs doesn't provide printDialog and etc. I want to print a page. Example I retrieved data from my database and I have a print button and when clicked, i want it to print the whole page. Thanks so much!

Upvotes: 0

Views: 1742

Answers (2)

nevra
nevra

Reputation: 428

You can use Crystal Reports in Visual Studio 2010. Add your project to dataset and print button is prepared. If you want to use Visual Studio 2013 (it doesn't support Crystal Report) you can add your form or your page Report Viewer from Toolbox, design your report and select your dataset, choose report and set your view.

Upvotes: 0

Tim Southard
Tim Southard

Reputation: 614

Use javascript to launch the print dialog

<button onclick="window.print()">Print</button>

Upvotes: 1

Related Questions