Infragistics Home

Infragistics Forums

Infragistics community online discussions.
Welcome to Infragistics Forums Sign in | FAQ
in Search

Error with GaugeImages

Last post 08-08-2008 16:19 by [Infragistics] Tony Lombardo. 17 replies.
Page 1 of 2 (18 items) 1 2 Next >
Sort Posts: Previous Next
  • 07-24-2008 14:50

    Error with GaugeImages

    I followed the instructions on: http://community.infragistics.com/articles/build-custom-sharepoint-webpart.aspx and I am getting an error when I include the Web Part on my page. The error complains about missing the Virtual Directory to store the Gauge Images. So, I set the "DeploymentScenario.FilePath" property to point to

    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??

    • Post Points: 20
  • 07-24-2008 15:12 In reply to

    Re: Error with GaugeImages

    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.

    Deploying

    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.

     

     

    Anthony Lombardo
    Lead Technical Evangelist
    Infragistics, Inc.
    Worldwide Evangelism Group

    tonyl@infragistics.com
    blogs.infragistics.com

    • Post Points: 20
  • 07-24-2008 15:53 In reply to

    Re: Error with GaugeImages

    Still nothing. I have submitted a support incident. Maybe the Infragistics folks can help me.

    • Post Points: 5
  • 07-24-2008 15:56 In reply to

    Re: Error with GaugeImages

    It's very frustraing becuase the "article" on the website makes it look very easy to add the controls to Web Parts, but obviously there are many setup/administration type steps that are missing in that article.  :(

    • Post Points: 20
  • 07-24-2008 17:08 In reply to

    Re: Error with GaugeImages

    Shayne, are you using MOSS or Office 2003?  In office 2003 you needed to add an "exclusion" in MOSS you need to add a wilcard inclusion.  Minor difference, but something to note.

    Anthony Lombardo
    Lead Technical Evangelist
    Infragistics, Inc.
    Worldwide Evangelism Group

    tonyl@infragistics.com
    blogs.infragistics.com

    • Post Points: 20
  • 07-24-2008 17:28 In reply to

    Re: Error with GaugeImages

    WSS 3.0

    Here is what I have done (I followed the Deployment instructions in the Infragistics Help):

    Created a "virtual" directory called "ig_common" in ISS, this virtual directory points to "C:\Infragistics". Inside this directory there are two folders: 20082CLR and Images. (With several files and subdirectories below these.)

    I missed your original point about "excluding" the directory in SharePoint. Do I still need to do that with the Virtual Directory? If so, how???

    • Post Points: 5
  • 07-25-2008 9:22 In reply to

    Re: Error with GaugeImages

    Not only do I need to know how to seup the "exluding directory" I am also having a hard time understanding EXACTLY where in the file sytem I can redirect the image path to (evidently the "ig_common" virtual directory solutution doesn't work...). I mean, because of Sharepoint I am not sure exactly where the "root" of the path should be. I think it is "IT", but when I look in Inetput there is no "IT", even thought that is the path you take to the sharepoint site via URL. Understand what I am saying?

     For Instance, the path to my Sharepoint site is http://loch24/IT/Infragistics/default.aspx  Although, when I look in the Inetpub directory on the server, there is no "IT" or "Infragistics' directory anywhere. (It is obviously being handled by sharepoint.) So, if I wanted to redirect the Images to a location such as "Infragistics\Images" (using  the "DeploymentScenario.FilePath" property), I am not even sure where to create the new directory in the filesystem and how to exclude it via Share Point admin, due to the fact that I am not sure what the "root" of my app is on the actual filesystem. Confused yet? haha I am!

    • Post Points: 20
  • 07-25-2008 14:25 In reply to

    Re: Error with GaugeImages

    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

    Anthony Lombardo
    Lead Technical Evangelist
    Infragistics, Inc.
    Worldwide Evangelism Group

    tonyl@infragistics.com
    blogs.infragistics.com

    • Post Points: 20
  • 07-25-2008 15:17 In reply to

    Re: Error with GaugeImages

     

    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...>

    • Post Points: 5
  • 07-25-2008 15:25 In reply to

    Re: Error with GaugeImages

    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 _Grid As igGrid.UltraWebGrid
    Private ReadOnly Property Grid() As igGrid.UltraWebGrid
       Get
            Me.EnsureChildControls()
            Return Me._Grid
       End Get
    End Property

    Private _Gauge As igGauge.UltraGauge

    Private ReadOnly Property Gauge() As igGauge.UltraGauge
      Get
         Me.EnsureChildControls()
         Return Me._Gauge
      End Get
    E
    nd Property

     

    Protected Overrides Sub CreateChildControls()
         MyBase.CreateChildControls()

      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

    • Post Points: 20
  • 07-29-2008 10:21 In reply to

    Re: Error with GaugeImages

    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

    Anthony Lombardo
    Lead Technical Evangelist
    Infragistics, Inc.
    Worldwide Evangelism Group

    tonyl@infragistics.com
    blogs.infragistics.com

    • Post Points: 20
  • 07-29-2008 14:53 In reply to

    Re: Error with GaugeImages

     

    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.

    Wouldn't I need to create the image file "Gauge_#SEQNUM(100).jpg" somewhere??

     

    • Post Points: 20
  • 07-31-2008 12:00 In reply to

    Re: Error with GaugeImages

    Hi Shayne,

    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. 

    Anthony Lombardo
    Lead Technical Evangelist
    Infragistics, Inc.
    Worldwide Evangelism Group

    tonyl@infragistics.com
    blogs.infragistics.com

    • Post Points: 20
  • 08-01-2008 11:46 In reply to

    Re: Error with GaugeImages

     

    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?

    • Post Points: 20
  • 08-01-2008 14:46 In reply to

    Re: Error with GaugeImages

    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

    Anthony Lombardo
    Lead Technical Evangelist
    Infragistics, Inc.
    Worldwide Evangelism Group

    tonyl@infragistics.com
    blogs.infragistics.com

    • Post Points: 35
Page 1 of 2 (18 items) 1 2 Next >
Powered by Community Server (Commercial Edition), by Telligent Systems