The axWebBrowser will not render either the bmp or the jpg files. IE 7 will
render the jpg file but not the bmp files. I've even tried converting the
bitmaps to GIF files and it's the same - IE7 OK, axWebBrowser - Not OK.
Here's more...the HTML being sent to the axWebBrowser is a simple table
(below). Our first take on this was to generate an HTML file saved to disk
and launch IE. This will now work for us as we've learned that if we change
our file type to jpg or gif IE is cool with that. When we tried to embed
this report into the app we found that none of the file types display. When
we run the app and right click on the browser control and do a view source,
what displays in notepad is <HTML></HTML>...I don't get that...
Here's the code that loads the browser control (axWeb06):
try
{
StringBuilder sbHtml = new StringBuilder();
axWeb06.Navigate("about:blank", ref _empty, ref _empty, ref _empty, ref
_empty);
_doc = axWeb06.Document as IHTMLDocument2;
//wait for document to load
while (_doc.body == null) Application.DoEvents();
strHitChart = "<table border=1><tr><td colspan=2 align=center><B>HIT CHART "
+ lbHitTeam.Text + " " + lbHitYear.Text + " " + strDowns +
"Downs</td></tr><tr>";
sbHtml.Append (strHitChart);
// database queries follow to get the rest of the data and do subsequent
sbHtml.Append...
//write the HTML to the document's body
_doc.body.innerHTML = sbHtml.ToString();
}
catch(Exception ex)
{
MessageBox.Show("Error generating HIT Chart - " + ex.Message);
}
This is the html result:
<table border=1><tr><td colspan=2 align=center><B>HIT CHART OHIO 2005
1st&2nd Downs</td></tr><tr><td><table><tr><td><b><u>S UNO SL</u>: <font
color=Blue>TOL </font><font color=DeepPink>BSU </font><font
color=LimeGreen>BUFF </font></TD></TR><TR><TD width=400><b>BBPS:<font
color=DeepPink>1 </font><font color=LimeGreen>3 </font>BNCE NKO:<font
color=DeepPink>7 </font>BUB SCRN:<font color=Blue>1 </font></TD></TR><tr><td
align=center><b>9 - 12</b></td></tr> <tr><td><img
src='Formation3.gif'></img> </td></tr><TR><TD width=400><b>ZN:<font
color=Blue>2 </font><font color=DeepPink>1 </font>ZN WK:<font color=Blue>2
</font><font color=DeepPink>4
</font></TD></TR></table></td><td><table><tr><td><b><u>GO UNO</u>: <font
color=Blue>TOL </font><font color=DeepPink>BSU </font><font
color=LimeGreen>BUFF </font></TD></TR><TR><TD width=400><b>Z SWP NKD
WK:<font color=Blue>7 </font><font color=DeepPink>1 </font>Z SWP ROLL TRW
BK:<font color=LimeGreen>1 </font></TD></TR><tr><td align=center><b>3 -
9</b></td></tr> <tr><td><img src='Formation4.gif'></img> </td></tr><TR><TD
width=400><b>FK HND SWP QB CTR T:<font color=LimeGreen>1 </font>Z SWP:<font
color=LimeGreen>2
</font></TD></TR></table></td></tr><tr><td><table><tr><td><b><u>GO UNO
SL</u>: <font color=LimeGreen>BUFF </font></TD></TR><TR><TD
width=400><b>BNCE BT:<font color=LimeGreen>1 </font>STRCH BT:<font
color=LimeGreen>1 </font></TD></TR><tr><td align=center><b>0 -
2</b></td></tr> <tr><td><img src='Formation6.gif'></img> </td></tr><TR><TD
width=400><b></TD></TR></table></td><td><table><tr><td><b><u>GU UNO</u>:
<font color=DeepPink>BSU </font></TD></TR><TR><TD
width=400><b></TD></TR><tr><td align=center><b>6 - 0</b></td></tr>
<tr><td><img src='Formation7.gif'></img> </td></tr><TR><TD
width=400><b>ZN:<font color=DeepPink>5 </font>ZN WK:<font color=DeepPink>1
</font></TD></TR></table></td></tr><tr></tr></table>