Tutorial :C#: Printing a Report



Question:

How can I add regular printing functionality to my application so that I can create a custom report (say, in an RTF format) to print? Also, is it somehow possible to combine print preview with this?

UPDATE: Oh and also, what is built-in in the .NET Framework in terms of printing?


Solution:1

You could try the ReportViewer that is shipped with Visual Studio. It covers both Windows Forms and Web Forms. http://msdn.microsoft.com/en-us/library/ms251671(VS.80).aspx


Solution:2

You will open yourself up to a world of pain here, and this problem has been solved before.

What are you trying to print? I'll assume you have a win-forms application.

When you say custom, do you mean the user will be entering the rtf or html code themselves (either manually, or with an editor such as WMD or tinyMCE)

You could drop in an Internet Explorer control, and invoke a print from there. Or there are plenty of other options.


Solution:3

Take a look at some commercial packages like the Xtra Reports suite from DevExpress


Solution:4

I'd use a 3rd party as Pratik mentioned, Active reports is quite simple, or if need a more robust can use SSRS.


Note:If u also have question or solution just comment us below or mail us on toontricks1994@gmail.com
Previous
Next Post »