Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
130
UltraWebChart.LoadPreset Issue
posted

Hi, currently I've been having an issue with the loadpreset method for ultrawebchart.  I have a webchart on my webpage which is bare and invisible when I create it. 

<igchart:UltraChart runat="server" Visible="false" ID="ultraChart1"></igchart:UltraChart> 

When a user clicks on a specific piece of data my code looks to see if there is a chart attached to it.  If there is then it set the visible property to true and binds the data from xml.  Here is my c# code that sets the file path for the xml file and reads through it.

            FileInfo fi = new FileInfo(FileName);
      string strDirectory = fi.Directory.Parent.FullName;
      XmlTextReader xmlReader = null;
      XmlReader reader = null;
       

      try

      {

            xmlReader = new XmlTextReader(FileName);
            XmlReaderSettings settings = new XmlReaderSettings();
            settings.IgnoreWhitespace = true;
            reader = XmlReader.Create(xmlReader, settings);
            reader.Read();
            OLAPDashboardProperties dp = new OLAPDashboardProperties(); 

           while (reader.Read())

            {

              .

                         .

                         .                       
                      
else if (reader.Value.ToString() == "Chart1Settings")            { 

            reader.Read();

            string str = reader.Value;

            ultraChart1.LoadPreset(Path.Combine(strDirectory, str), false);

            }

              .

                         .                        

                         .

The ultraChart1.LoadPreset(Path.Combine(strDirectory, str), true); line returns a “Object reference not set to an instance of an object” error.  The ultraChart1 gets set in the html, and strDirectory and str are both valid file paths.  Also I have tried the string overload method of LoadPreset and returns the same thing. 

I’m currently stumped as to why this is happening so any help will be much appreciated.  If I need to provide anymore code or explanation please ask.

Thanks for any help in advance. 

 

Parents
No Data
Reply
  • 28496
    Offline posted

     A null reference exception in LoadPreset sounds like a bug on our part.  Have you tried downloading the latest available hotfix for 6.1 and testing with that version?

    Looking at our bug tracking database, I found one issue that looks similar: BR12896, which was fixed in build 6.1.20061.1042

Children