I need to change the Path of the URL to open our network on the right client folder based on the project # which is a field in my dashboard and is accessible through the customization
In Customization, I see something called URLPanel1 wit a EpiGuid but I don’t know what I’m suppose to change or how I’m suppose to access this object in C# to change the property.
\servername\Fichiers\Clients\ {client}
And the token has Customer_Name as the Publisher but when I refresh everything, it doesn’t work even if the folder exist on the network. Seems hard to find the problem, any way to alert/print the URL used somewhere?
I pretty much puth the windows explorer in this so i want it to open a folder. It works great for my base folder but I want to dig deeper into the client folder and then the project folder later.
I only have one of these looking at a folder, and I have it static like you did. The ones that I have tokens for are looking at URL’s or PDF files. Those ones change and I move from row to row in the grid that’s being published from.
What happens when you hit this refresh? (I should ask which refresh are you hitting?)
I’m hitting the refresh on top and the refresh all button. If I clique on refresh IN the URL tab it just refresh the current folder
Edit: THe only way to make it work is to change the client, open the URL settings, click OK. Now it’s changing. But I don,t want to do that since I don’t have the Panel normally by deploying it
No problem, it would be nice to have something to make it work. If I was able to refresh the URL in customization in the script editor, it would be probably work since it does take the variable it just doesn’t recognize when to update.
Finally, it’s working after deploying the report but when I open the report the first time or when the folder doesn’t exist, I get an error message saying that the folder doesn’t exist (seems like the customer name isn’t loaded at this time)
The folder is located on: path\[client]\[projectID] - [projectDescription].
Is it possible to prevent error messages from this? People don,t want to see error messages if the folder doesn’t exist on the network.
Did you ever figure out if you could suppress this error? I’m about to start a project where I might use this URL window, and how I set things up might be influenced by whether or not I can get rid of this error.
I found a solution but it’s not perfect (but it works well so far). I create a WebBrowser and I define myself the URL. I need to create the toolbar and the buttons (previous, forward, refresh) manually:
In class Script, initialize this variable:
private WebBrowser browserDisplay = new WebBrowser();`
In InitializeCustomCode(), initialize the Webbrowser:
EpiBasePanel TrackerPanel = (EpiBasePanel)csm.GetNativeControlReference("9fc6a346-e062-4c54-a790-6e37882f4463-4"); // put your Guid instead
browserDisplay.Dock = System.Windows.Forms.DockStyle.Bottom;
browserDisplay.Location = new System.Drawing.Point(0, 40);
browserDisplay.MinimumSize = new System.Drawing.Size(20, 20);
browserDisplay.Name = "browserDisplay";
browserDisplay.Size = new System.Drawing.Size(784, 561);
browserDisplay.TabIndex = 9999;
browserDisplay.WebBrowserShortcutsEnabled = false;
browserDisplay.IsWebBrowserContextMenuEnabled = false;
browserDisplay.ScriptErrorsSuppressed = true;
TrackerPanel.Controls.Add(browserDisplay); //TrackerPanel is the name of the Control where you want your file explorer
browserDisplay.BringToFront();
/*navigate to a blank page on initialization*/
string url = @"\\server\Fichiers\Clients\";
browserDisplay.Navigate(url);
ToolStrip mainToolBar = new ToolStrip();
mainToolBar.Size = new System.Drawing.Size(400, 40);
Color color = Color.FromArgb(255,88,85,85);
mainToolBar.BackColor = color;
//create previous button
ToolStripButton buttonPrevious = new ToolStripButton();
buttonPrevious.Image = EpiUIImages.SmallEnabledImages.Images[EpiUIImages.IndexOf("PickerRemove")];
buttonPrevious.Click += new System.EventHandler(buttonPrevious_Click);
//create forward button
ToolStripButton buttonForward = new ToolStripButton();
buttonForward.Image = EpiUIImages.SmallEnabledImages.Images[EpiUIImages.IndexOf("PickerAdd")];
buttonForward.Click += new System.EventHandler(buttonForward_Click);
//create refresh button
ToolStripButton buttonRefresh = new ToolStripButton();
buttonRefresh.Image = EpiUIImages.SmallEnabledImages.Images[EpiUIImages.IndexOf("Refresh")];
buttonRefresh.Click += new System.EventHandler(buttonRefresh_Click);
// add buttons to toolbar
mainToolBar.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
buttonPrevious,
buttonForward,
buttonRefresh
});
TrackerPanel.Controls.Add(mainToolBar);
In whatever event in your code, you can change the URL with this: