Me._Gauge.DeploymentScenario.FilePath = "C:\Infragistics\GaugeImages"
and the page wont load at all. I also tried:
Me._Gauge.DeploymentScenario.FilePath = "C:\Inetpub\wwwroot\wss\VirtualDirectories\80\Infragistics\GaugeImages" (and I created the dir of course)
Finally (yes, last of course) I read the directions and also tried creating the "ig_common" virtual directory and I put all images, scripts, forms, etc there as the instructions outlined. Still, I get the same error.
Any ideas? Is it something to do with directory permissions, or am I somehow setting the "FilePath" property wrong, or what?
Thanks!Shayne
Ideas??
Hi Shayne,
This sounds like a permissions issue. The ASP.NET_WP isn't going to have acecss to root folders like C:\infragistics\gaugeimages, you would need to specifically grant permissions to that folder for that process. Alternatively, you could use the virtual directory, which would have access granted through IIS. However, anything under wwwroot gets 'stepped' on by SharePoint. To tell SharePoint to keep its hands off your folder, you need to add it as a folder inclusion. I think that might be the step you're missing.
You will need to copy any Infragistics assemblies used as references, along with your custom assembly, to your Microsoft Office SharePoint Server. It is best to install the assemblies into the GAC to avoid Code Access Security exceptions. Because NetAdvantage for ASP.NET [CLR2] assemblies contain the necessary JavaScript files as embedded resources, creating a virtual directory for script files is not required; however, should you want to use custom images or CSS style sheets, you will want to set up a directory for those resources. You will also need to inform WSS of the directory and mark it for “Wildcard Inclusion.” You can use IIS to add a virtual directory, which will contain all of your resources, to your SharePoint site. Once you have added the virtual directory, use the SharePoint Central Administration page to include the directory.
Still nothing. I have submitted a support incident. Maybe the Infragistics folks can help me.
I feel your pain, welcome to SharePoint :)
Here's what you have to keep in mind. SharePoint works as an ISAPI filter which intercepts ALL requests aimed at the site. So, there's no such thing as /IT/Infragistics/default.aspx in IIS or on your filesystem. That's actually just a path that will inform the SharePoint filter where to pull the info out of a SQL Database.
That's where exclusions come into play. Exclusions tell SharePoint that when a request for /ig_common/images/background.png comes in, don't look in the SQL database, instead let IIS serve this request up.
If you want your final path to be /IT/Infragistics/ig_common/images/background.png, it's going to be difficult, since you'll need to create that whole subroot (/it/infragistics/ig_common) in IIS. I would instead recommend that you put /ig_common right off of your IIS root. So it will become http://loch24/ig_common... You can name the folder anything you want, you don't have to stick with ig_common, but you get the point.
Here's a Microsoft article on SharePoint and managed paths - http://technet.microsoft.com/en-us/library/cc287929(TechNet.10).aspx
If you still can't get the gauge images to show up, here's one more tip. View the page in a browser and right click on the gauge image (or missing image in this case). Click on properties, and check what the url source of the image is. Compare that to the URL you expected the image to be placed. Compare that to the value you set in the Guage's deployment settings. You can also post those values here and I'll see if anything looks off. My guess is that it's still just a managed path issue, and once you get that set up you'll be gold.
-Tony
Ugh... I am still not getting it.
The example from MS you gave me is for WSS 2.0. I found the palce in 3.0 where you setup managed paths, but it looks like it is to "include" managed paths, not "exclude" them. <Scratchiing head...>
I made some progress... The error is now gone, but there is no picture of the Gauge. The path (of the image file the page is trying to render) is:
http://loch24/IT/Infragistics/GaugeImages/ctl00_m_g_00ddde17_f263_4e84_aec2_1637e41b8357_Gauge_none.png?t=128614872734091261
Is "ctl00_m_g_00ddde17_f263_4e84_aec2_1637e41b8357_Gauge_none.png" an actual file name that the control is trying to deploy? Maybe there is no "image" assigned to this Gauge?
Remember, I haven't done ANYTHING in this test app, not binded any data, set any properties, etc.
Here is my source code (exatly like the one in the article on your site):
Private _Gauge As igGauge.UltraGauge
Me._Gauge = New igGauge.UltraGauge() Me._Gauge.ID = "Gauge" Me._Gauge.DeploymentScenario.FilePath = "\ig_common\Images" Me._Grid = New igGrid.UltraWebGrid("Grid") Me.Controls.Add(Me._Gauge) Me.Controls.Add(Me._Grid)
End Sub
The code example was kept simple in order to separate the webpart specific logic, from the control specific logic. The WebGauge has two main deployment scenarios, and the setup is critica in order to see results. Deployment is covered in the help (http://help.infragistics.com/Help/NetAdvantage/NET/2008.2/CLR2.0/html/Gauge_Image_Deployment_in_WebGauge.html). The main key is that there is a difference between deploymentScenario.FilePath and deploymentScenario.ImageUrl. The two properties work together, so if you change one, you need to change the other. In your case, setting the FilePath will force the gauge to save images to the \ig_common\Images folder. However, the ImageUrl property still tells the gauge that images can be served up with a url of "GaugeImages/{uniqueImageName}.png You need to adjust the ImageUrl to match what you've set for FilePath or vice-versa. So, you should set the url to something like gauge.DeploymentScenario.ImageUrl="/ig_common/images/Gauge_#SEQNUM(100).jpg" Also, the gauge.DeploymentScenario.FilePath takes a physical path, so setting it to "\ig_common\images" will actually set it to a subdirectory of the current page, which isn't what you want - you want a root level virtual directory. Instead, use gauge.DeploymentScenario.FilePath=Page.MapPath("/ig_common/images"); That will turn the virtual directory into a physical path and save chart images there. The DeploymentScenario isn't specific to SharePoint, so if you want to work in a classic ASP.NET web site to get a feel for working with these settings, it may be a little easier.
Hope this helps,
Ok.... I am getting about one reply a day from tech support, they aren't nearly the help you are. I am really reconsidering my purchase..... With that being said.. I really appreciate your help. So, if I use:
Me._Gauge.DeploymentScenario.ImageURL = "/ig_common/images/Gauge_#SEQNUM(100).jpg"Me._Gauge.DeploymentScenario.FilePath = Page.MapPath("/ig_common/images")
It gives me an error: An unexpected error has occurred.
I'm a bit stumped here. I don't know what the .Location property is, or where you found that. Was it in the SharePoint reference application code? If so, it may have been a mistake. The absolute simplest way to load up a gauge is to use the LoadPreset functionality, and feed it an XML file. That will allow you to create your Gauge at design-time using the designers and wizards.
Evidently the "Location" property is gone in v 3.5 for the UltraGauge. What is the equivalent replacement?
I finally made some good progress using the following code, I actually have a gauge appearing on my SharePoint Web Part now! Horray!
Me._Gauge = New igGauge.UltraGauge()Me._Gauge.ID = "Gauge"
'Dim ultraGauge1 As New Infragistics.Win.UltraWinGauge.UltraGauge()Dim myDigitalGauge As New SegmentedDigitalGauge()Dim mySolidFillBrushElement As New SolidFillBrushElement()Dim mySolidFillBrushElement1 As New SolidFillBrushElement()
'Set the number of digits. myDigitalGauge.Digits = 8
'Set the mode to 14-segment and the digit text to FM : 96.4. myDigitalGauge.Mode = SegmentMode.FourteenSegmentmyDigitalGauge.Text = "FM : 96.4"
Me.Controls.Add(Me._Gauge)
I wish there was a better sample from Infragistics for people (ME!) that don't really know what they are doing. :)
The problem I have is I am not just not sure how to 'translate' the ASPX code. How do I "work through the codebehind file"? You mean, not use the wizard? It seems like there should be a "simple" way to just show a gauge (as a web part), that is all I was trying to do to demo this to my boss (and expalin why I needed to spend the $$$ to get this tool....lol).
Thank you for all the help. Eventually, it will start "clicking" for me... eventually!
I usually do the following - if I want to do some quick prototype work, I'll use the designer and wizards and have it generate the ASPX markup in my classic ASPX page. When I'm ready to turn it into a user control, I'll manually 'translate' the ASPX into propert settings, or use the Guage's ability to "Save Preset" to generage an external xml file. The Gauge also has the ability to load a preset, so you can write a line of code that reads the XML file in and loads up all of your settings. The only complexity you'll have here is loading the file in your sharepoint application. But now that you've figured out how to work with external resources, this should be a simple task for you.
As an alternative, you can work through the codebehind file the entire time, avoiding genrating any ASPX. This will be a little slower than using the designers, but when you're done, it's a simple copy and paste of your code from the aspx.cs file into the webpart file.
One last solution you may want to look into is the SharePoint SmartPart which allows you to create declarative markup (user controls) as part of your sharepoint webpart. The project is up on codeplex - http://www.codeplex.com/smartpart
Yes. This was the problem. Now the error is gone and the Web Part generates an image called "Gauge_0.jpg". Of course, the image is blank because the code is so simple.
I appreciate your suggestion about using a knows environment. My issue with that, is (I am sure it is my limited understanding of ASP.Net) I am just not sure how to take the ASPX generated code and move it over to the Web Part. I mean, the ASP generated code includes alof os ASP specific tags. When I am coding for Web Parts, I am strictly using C# or VB. Understand what I am saying? The wizard generates ASP code, not just C# and/or VB code. How do I "copy/implement" that code in my web part?