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.
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,
-Tony
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.
The guage creates the image for you, using the FilePath you specified. The file name will end up replacing "#SEQNUM(100)" with a number between 0 and 100, so by the time you get 100 requests, the first gauge file will be overwritten. This ensures you don't flood your file system with temporary image files. The file only needs to live long enough for the web page to load and display the image.
Without a stacktrace it's very difficult to tell what the unexpected error is. If you enable the callstack (http://www.sharepointblogs.com/michael/archive/2007/06/28/sharepoint-under-the-hood-see-real-error-description-and-callstack-stack-trace.aspx) it will help you see the underlying error so that you don't have to play a game of guess and check. My guess is that either the "/ig_common/images" folder doesn't exist (it should be c:\inetpub\wwwroot\ig_common\images) - or the shareponit process doesn't have permissions to write files to that folder.
Again, I would recommend you first start out using the gauge in a known environment like a standard ASP.NET web application, and then move that code into SharePoint - that way you can start to get a clearer picture of what's a gauge problem, and what's a sharepoint problem.
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?