Open URL on an specific browser

Hello guys

I develop the customization below to be able to open ssrs reports inside epicor but i need that opens with IE browser does anyone can advice how to do it here is my code

// **************************************************
// Custom code for UD01Form
// Created: 10/09/2014 12:49:22 PM
// **************************************************
//
// Customization: EII_SSRS_GeneralLedger
// Description: Runs General Ledger SSRS report. Based on customization
// developed by Cre8tive Tech.
// Author: RBeaghan
//
// History:
// 2014-10-09 RLB -Initial C# version converted from CR8_SSRS_GeneralLedger.
//
// **************************************************
using System;
using System.ComponentModel;
using System.Data;
using System.Diagnostics;
using System.Windows.Forms;
using Ice.Lib;
using Erp.BO;
using Ice.BO;
using Ice.UI;
using Ice.Adapters;
using Erp.Adapters;
using Ice.Lib.Customization;
using Ice.Lib.ExtendedProps;
using Ice.UI.FormFunctions;
using Ice.Lib.Framework;
using Ice.Lib.Searches;
using System.Reflection;
using Ice.Core;

public class Script
{
// ** Wizard Insert Location - Do Not Remove ‘Begin/End Wizard Added Module Level Variables’ Comments! **
// Begin Wizard Added Module Level Variables **

// End Wizard Added Module Level Variables **

// Add Custom Module Level Variables Here **
WebBrowser	webBrowser1;

public void InitializeCustomCode()
{
	// ** Wizard Insert Location - Do not delete 'Begin/End Wizard Added Variable Initialization' lines **
	// Begin Wizard Added Variable Initialization

	// End Wizard Added Variable Initialization

	// Begin Wizard Added Custom Method Calls

	// End Wizard Added Custom Method Calls
	
	string strRptURL = string.Empty;
	
	// RLB: set form title
	UD01Form.Text = "Material Yield";
	
	webBrowser1 = new WebBrowser();
	webBrowser1.Dock = DockStyle.Fill;
	
	UD01Form.Controls.Add(webBrowser1);
	
	strRptURL = GetSSRSBaseURL() + "/Pages/ReportViewer.aspx?%2fCustom%2fOperational%2fMaterial+Yield&rs:Command=Render";
	webBrowser1.Navigate(new Uri(strRptURL));
	
	// Hide the EpiTreeViewPanel
	Ice.Lib.Framework.EpiTreeViewPanel	tree;
	object	obj1 = typeof(Ice.UI.App.UD01Entry.UD01Form).InvokeMember("epiTreeViewPanel1", 
																				BindingFlags.Instance | BindingFlags.GetField | BindingFlags.NonPublic, 
																				null, 
																				UD01Form, 
																				null);
	tree = (Ice.Lib.Framework.EpiTreeViewPanel)obj1;
	tree.Visible = false;
	
	// Hide the panels (Detail and List)
	object	obj2 = typeof(Ice.UI.App.UD01Entry.UD01Form).InvokeMember("baseDockManager", 
																				BindingFlags.Instance | BindingFlags.GetField |
																				BindingFlags.NonPublic, 
																				null, 
																				UD01Form, 
																				null);
	Infragistics.Win.UltraWinDock.UltraDockManager dock = (Infragistics.Win.UltraWinDock.UltraDockManager)obj2;
	// dock.DockAreas.RemoveAt(0);
	dock.HideAll();
}

private string GetSSRSBaseURL() 
{ 
	// Declare and Initialize EpiDataView Variables 
	// Create instance of Adapter? oTrans 
	Erp.Adapters.CompanyAdapter adapterCompany = new Erp.Adapters.CompanyAdapter(this.oTrans); 
	adapterCompany.BOConnect(); 
	
	// Declare and Initialize Variables 
	string strBaseURL = string.Empty; 
	string strCompany = ((Session)oTrans.Session).CompanyID; 
	 
	// Call Adapter method 
	bool result = adapterCompany.GetByID(strCompany); 
	 
	if (result)
	{ 
		strBaseURL = adapterCompany.CompanyData.Company.Rows[0]["Character01"].ToString(); 
	} 
	 
	// Clean-up Adapter Reference 
	adapterCompany.Dispose(); 
	adapterCompany = null; 
	
//	MessageBox.Show(strBaseURL); 
	
	return strBaseURL; 
} 

public void DestroyCustomCode()
{
	// ** Wizard Insert Location - Do not delete 'Begin/End Wizard Added Object Disposal' lines **
	// Begin Wizard Added Object Disposal

	// End Wizard Added Object Disposal

	// Begin Custom Code Disposal

	// End Custom Code Disposal
}

}

If you are using the WebBrowser control from .NET that is already IE…
If you want to Launch it outside of Epicor and or a Custom Control then you can use processes exec as shown

Process.Start("iexplore.exe","http://myurl.com");

You could also look into embeding a ReportViewer control which is made specifically to render SSRS Reports.

thank you

It might not apply, but I’ve used the following to open SSRS report with
MES Buttons.

​Process.Start(“iexplore.exe”, “SSRS REPORT URL”);​

Thanks,

Norman Hutchins
System Administrator
Howell Laboratories, Inc.

You can also do this through the menu structure in Epicor itself as a menu item….just through worth mentioning….may not apply here….

M. Manasa Reddy
P: 703.471.7145 x454
manasa@euclidsys.commailto:manasa@euclidsys.com

1 Like

Hello guys i am having an error when i run the ssrs report inside the system with my customization i have narrow down the problem and i know the problem is the report server the viewer file but i have no idea how to fix it bellow i will add my code and the error screen.

// Add Custom Module Level Variables Here **
WebBrowser	webBrowser1;

public void InitializeCustomCode()
{
	// ** Wizard Insert Location - Do not delete 'Begin/End Wizard Added Variable Initialization' lines **
	// Begin Wizard Added Variable Initialization

	// End Wizard Added Variable Initialization

	// Begin Wizard Added Custom Method Calls

	// End Wizard Added Custom Method Calls
	
	string strRptURL = string.Empty;
	
	// RLB: set form title
	UD01Form.Text = "Material Yield";
	
	webBrowser1 = new WebBrowser();
	webBrowser1.Dock = DockStyle.Fill;
	
	UD01Form.Controls.Add(webBrowser1);
	
	strRptURL = GetSSRSBaseURL() + "/Pages/ReportViewer.aspx?%2fCustom%2fOperational%2fMaterial+Yield&rs:Command=Render";
	//
	webBrowser1.Navigate(new Uri(strRptURL));
	
	// Hide the EpiTreeViewPanel
	Ice.Lib.Framework.EpiTreeViewPanel	tree;
	object	obj1 = typeof(Ice.UI.App.UD01Entry.UD01Form).InvokeMember("epiTreeViewPanel1", 
																				BindingFlags.Instance | BindingFlags.GetField | BindingFlags.NonPublic, 
																				null, 
																				UD01Form, 
																				null);
	tree = (Ice.Lib.Framework.EpiTreeViewPanel)obj1;
	tree.Visible = false;
	
	// Hide the panels (Detail and List)
	object	obj2 = typeof(Ice.UI.App.UD01Entry.UD01Form).InvokeMember("baseDockManager", 
																				BindingFlags.Instance | BindingFlags.GetField |
																				BindingFlags.NonPublic, 
																				null, 
																				UD01Form, 
																				null);
	Infragistics.Win.UltraWinDock.UltraDockManager dock = (Infragistics.Win.UltraWinDock.UltraDockManager)obj2;
	// dock.DockAreas.RemoveAt(0);
	dock.HideAll();
}

private string GetSSRSBaseURL() 
{ 
	// Declare and Initialize EpiDataView Variables 
	// Create instance of Adapter? oTrans 
	Erp.Adapters.CompanyAdapter adapterCompany = new Erp.Adapters.CompanyAdapter(this.oTrans); 
	adapterCompany.BOConnect(); 
	
	// Declare and Initialize Variables 
	string strBaseURL = string.Empty; 
	string strCompany = ((Session)oTrans.Session).CompanyID; 
	 
	// Call Adapter method 
	bool result = adapterCompany.GetByID(strCompany); 
	 
	if (result)
	{ 
		strBaseURL = adapterCompany.CompanyData.Company.Rows[0]["Character01"].ToString(); 
	} 
	 
	// Clean-up Adapter Reference 
	adapterCompany.Dispose(); 
	adapterCompany = null; 
	
//	MessageBox.Show(strBaseURL); 
	
	return strBaseURL; 
} 

public void DestroyCustomCode()
{
	// ** Wizard Insert Location - Do not delete 'Begin/End Wizard Added Object Disposal' lines **
	// Begin Wizard Added Object Disposal

	// End Wizard Added Object Disposal

	// Begin Custom Code Disposal

	// End Custom Code Disposal
}

}

Hi Alex
That is likely because the version of the IE Explorer engine that the WebBrowser control uses is old. Version 7 I believe… you are going to have to use a different control and set the configuration of your WebBrowser control to use a more recent version of the IE Engine.

i have the last version IE 11 and also when i open the report outside of epicor directly with IE i dont have that error i just get the eror when i open it inside epicor. and my default browser is IE

Right, is because by default the Embeded Browser control is set to use the IE7 engine (read the link I sent)

Your best bet here is to use the ReportViewer control which is built specifically to render SSRS Reports as I pointed out before. The web browser control is clumsy at best and will require a lot of tweaking to make it work

another thing to consider. create a dashboard as “New URL/XSLT View”.

Yes that is a little used function.
You can reference the attachments linked to things in a dashboard like PDFs and have them display using that function.

We showed this the accounts team at one customer and they liked reviewing the scanned in Logged AP invoices.

1 Like

Prakash when i try to deploy the URL Dashboard i get the error showed below. Have you run on this error?

Hi Alex,

We are in Epicor 10.1.400.8. All works fine in our system. can you test it by entering url as www.google.com or www.epicor.com. whats your Epicor version?

FYI: you can dynamically change the url applying tokens in the “Query Phrase Subscribers”. the right click context menu does not work. still ctrl+c works.

thanks for your replay i got that error because i put “[ssrs]” at the end of the dashboard name

Guys after create the dashboard i kept getting the script error in order to fix it you need to install UR03 for SQL and that solve the script problem

I don’t suppose there is any way to tell it to use a browser that is NOT IE? We were investigating embedding some web pages into a customization but they are all totally broken in IE (for instance, extensive use of ES6 features).

Here’s how to get rid of Internet Explorer - CNET

Microsoft will bid farewell to Internet Explorer and legacy Edge in 2021 - The Verge

You want to check out CEF Sharp
Is basically embedded Chrome

Works great! And you can put it on all your customizations pretty easily

1 Like