views:

24

answers:

1

I basically have an application that generates reports in a .html file, I use a .html file for the ease of making tables and formatting text.

Now I would like to introduce a way of printing the reports from my program. Because I use a .html file, the formatting would not the correct if I was to print it directly from my application (as far as I know). For this reason, I would like to print it just like my web browser would have in order to keep the tabular data intact and the text formatting.

Does anyone know a way to do this?

Thank you.

+1  A: 

CSS can do everything you need. You may want to open the document in its own window (or Iframe) with its own stylesheet specifically designed for your report.

See: http://stackoverflow.com/questions/401623/good-rules-for-setting-up-print-css

Diodeus
That kinda helps, but the problem still remains when I'm trying to print for example `report.html`, it won't come out the way I want when I print it directly from my program will it? I need it to print in the same way it would print from your web browser (as it has HTML tables and such). Thanks.
Yawn.
Try the .NET web browser control: http://msdn.microsoft.com/en-us/library/system.windows.forms.webbrowser.aspx
Diodeus