Creating HTML reports

  • Thread starter Thread starter bob
  • Start date Start date
B

bob

Hello,
I'm trying to create reports in my application using HTML. I don't
want to mess around typing in stuff like
html = "<Table>blah</Table>"

I want something like
row = new HTMLRow("Some text 1", "Some text 2");
table = new HTMLTable(row);
header = new HTMLHeader("Report header");
page = new HTMLPage(header, table);

I think mshtml should help but I haven't had much luck with it, is
there a guide anywhere?

Has anyone had any experiance with this sort of thing?

Thanks,
Bob
 
Hi James,

thanks for replying.

I've looked at that code and you're right; using MSHTML to create HTML
seems to be absolutly horrific (why am I not surprised).

But if I just go straight in and start typing HTML into my code will
it not be difficult to make it consistant? Won't composing reports
from a load of seperate objects be a pain if they just answer strings?
How will I know if a report object is a page or just a table, they'll
both be strings so how can I reliably add more info to a report?

Is this really the best way to create reports in C#?

heading = CreateHeading();
anObjReport = anObject.CreateReport();
page = "<Page>" + heading + anObjReport + "</Page>";

Bob
 
Hi Bob:

Maybe I'm missing something or maybe you've already tried this, but
have you tried a DataGrid control? You wouldn't have to manually setup
any rows.
 
Back
Top