Disclaimer The opinions expressed herein are my own personal opinions and do not represent my employer's view in anyway.
So now you have a nice report written to an HTML file. How do you open it for the user to view it using IE? You could try this:
System.Diagnostics.Process.Start("iexplore.exe","MyReport.htm");
But this hasn't always worked for me. Here is a sure fire way to put it all together.
Add a project reference to the COM library, Microsoft Internet Controls. Add these two using statements:
using SHDocVw;using System.Runtime.InteropServices;
Where you need to open the browser, add the following code:
explorer = new InternetExplorer(); if (explorer != null) { explorer.Visible = true; object x = null; explorer.Navigate(@"MyReport.htm", ref x, ref x, ref x, ref x); }
Thanks to a good friend of mine, Micheal Beall of Overdrive Technologies, for helping me with this.
***Originally posted on DotNetJunkies on February 16, 2005
Remember Me