0

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.

Yawn.
  • 1

1 Answers1

1

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: Good rules for setting up print css?

Community
  • 1
  • 1
Diodeus - James MacFarlane
  • 112,730
  • 33
  • 157
  • 176
  • 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. Apr 19 '10 at 13:56
  • Try the .NET web browser control: http://msdn.microsoft.com/en-us/library/system.windows.forms.webbrowser.aspx – Diodeus - James MacFarlane Apr 19 '10 at 14:01