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.
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.
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?
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
-Tony
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'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.