private void menuViewBrowser_Click(object sender, System.EventArgs e)
{
MDIChild mc = this.ActiveMdiChild as MDIChild;
if (mc == null)
return;
try
{
menuToolsStartProcess(true); // start desktop if not already up
DesktopConfig dc = DialogToolOptions.DesktopConfiguration;
string rdlfile = Path.GetFileNameWithoutExtension(mc.SourceFile.LocalPath) + "_" + (++TEMPRDL_INC).ToString() + TEMPRDL;
Uri file;
if (Path.IsPathRooted(dc.Directory))
{
file = new Uri(dc.Directory + Path.DirectorySeparatorChar + rdlfile);
}
else
{
file = new Uri(AppDomain.CurrentDomain.BaseDirectory +
dc.Directory + Path.DirectorySeparatorChar + rdlfile);
}
if (_TempReportFiles == null)
{
_TempReportFiles = new List<Uri>();
_TempReportFiles.Add(file);
}
else
{
if (!_TempReportFiles.Contains(file))
{
_TempReportFiles.Add(file);
}
}
StreamWriter sw = File.CreateText(file.LocalPath);
sw.Write(mc.SourceRdl);
sw.Close();
// http://localhost:8080/aReport.rdl?rs:Format=HTML
Uri url = new Uri(string.Format("http://localhost:{0}/{1}?rd:Format=HTML", dc.Port, rdlfile));
System.Diagnostics.Process.Start(url.AbsoluteUri);
}
catch (Exception ex)
{
MessageBox.Show(ex.Message, Strings.RdlDesigner_Show_UnableShowReport);
}
}