FP2006 Posted May 9, 2007 Report Share Posted May 9, 2007 We have charts were users can optional show and configure the stat extension. We allow users to save their settings (both core ChartFx object and Stat Settings) and reuse them as the data from our application is refreshed. We implement this with the FileContents with both the Extensions and Reuse Extensions settings turned on. When we do this all of the chart settings (colors, fonts, etc.) are remembered when we reload the XML files. However, the Statistical Study settings are cleared. So if I have a bar chart where the user has turned on the "mean", the next time the data is refreshed, the system respects all of the customizations made to the chart by the user except for the fact that the "mean" should be displayed. The following code is what is being used for the FileContents setting... Me.FileContents = ChartFX.WinForms.FileContents.All Me.FileContents = ChartFX.WinForms.FileContents.General Or ChartFX.WinForms.FileContents.Fonts Or ChartFX.WinForms.FileContents.Scale Or ChartFX.WinForms.FileContents.ColorsAndStyles Or ChartFX.WinForms.FileContents.SeriesAttributes Or ChartFX.WinForms.FileContents.PerPointAttributes Or ChartFX.WinForms.FileContents.DockableBars Or ChartFX.WinForms.FileContents.Extensions Or ChartFX.WinForms.FileContents.Pictures Or ChartFX.WinForms.FileContents.AxisSections Or ChartFX.WinForms.FileContents.CustomGridlines Or ChartFX.WinForms.FileContents.ReuseExtensions Any thoughts? Thanks for the help. Link to comment Share on other sites More sharing options...
FP2006 Posted May 14, 2007 Author Report Share Posted May 14, 2007 Let me know if this question needs to be reworded to help clarify. Thanks. Link to comment Share on other sites More sharing options...
Frank Posted May 14, 2007 Report Share Posted May 14, 2007 We are unable to reproduce this problem. I tried creating a chart, added some studies, then saved the chart into an XML. Later, I imported the XML into a brand new chart and all the studies were there. Please post a sample application that reproduces the problem. Link to comment Share on other sites More sharing options...
FP2006 Posted December 21, 2007 Author Report Share Posted December 21, 2007 I think the issue appears when you import the XML settings into a chart that already has a statistical extension turned on. It looks like you imported to a completely new chart. Below are the code snippets we are using... Public Sub SaveLayout(ByRef PropertyBag As String, ByVal View As Integer) Implements Framework.Reporting.IDisplayObject.SaveLayout Dim DisplayPropertyBag AsUtilities.XMLSettings Dim Settings AsString 'Lets initialize the property bag DisplayPropertyBag = New Utilities.XMLSettings("Display", PropertyBag) Settings = Me.GetUserSettings DisplayPropertyBag.WriteSettings("ChartLayout",Me.Name & "-("& View.ToString & ")",Settings, GetType(System.String)) PropertyBag = DisplayPropertyBag.XML End Sub Public Function GetUserSettings() AsString Dim MS AsSystem.IO.MemoryStream Dim MSR AsSystem.IO.StreamReader Try MS = New System.IO.MemoryStream Me.FileContents =ChartFX.WinForms.FileContents.All Me.FileContents =ChartFX.WinForms.FileContents.General OrChartFX.WinForms.FileContents.Fonts OrChartFX.WinForms.FileContents.Scale OrChartFX.WinForms.FileContents.ColorsAndStyles OrChartFX.WinForms.FileContents.SeriesAttributes OrChartFX.WinForms.FileContents.PerPointAttributes OrChartFX.WinForms.FileContents.DockableBars OrChartFX.WinForms.FileContents.Extensions OrChartFX.WinForms.FileContents.Pictures OrChartFX.WinForms.FileContents.AxisSections OrChartFX.WinForms.FileContents.CustomGridlines OrChartFX.WinForms.FileContents.ReuseExtensions Me.Export(FileFormat.Xml,MS) MSR = New System.IO.StreamReader(MS) MS.Position = 0 Return MSR.ReadToEnd Catch ex AsSystem.Exception Return "" End Try End Function Public Sub SetUserSettings(ByValSettings As String) Dim MS AsSystem.IO.MemoryStream Dim MSW As System.IO.StreamWriter MS = New System.IO.MemoryStream MSW = New System.IO.StreamWriter(MS) MSW.Write(Settings) MSW.Flush() MS.Position = 0 Dim MSR AsSystem.IO.StreamReader MSR = New System.IO.StreamReader(MS) MS.Position = 0 Me.Import(FileFormat.Xml, MS) Me.RecalculateScale() End Sub Public SubApplySavedChartLayout(ByVal PropertyBag As String, ByVal View As Integer) ImplementsFramework.Reporting.IDisplayObject.ApplySavedChartLayout Dim DisplayPropertyBag AsUtilities.XMLSettings Dim Settings AsString 'Lets initialize the property bag DisplayPropertyBag = New Utilities.XMLSettings("Display", PropertyBag) Settings = DisplayPropertyBag.GetSettings("ChartLayout",Me.Name & "-("& View.ToString & ")", "", GetType(System.String)) If Settings <> ""Then Me.SetUserSettings(Settings) End Sub Link to comment Share on other sites More sharing options...
FP2006 Posted January 4, 2008 Author Report Share Posted January 4, 2008 I saw this response in the "extensions" forum. Is it related? Adding the .clear did not fix the issue for us, so I am wondering if it is something in the code snipets we sent that we are doing wrong. thanks for the help! --------------------------------------------------------------------------------------- There'sseems to be a problem importing a financial or statistical chart to achart that has one of these extensions already added. Please call theClear() method of the Extensions object before calling the Import()method. You can do as follows: chart1.Extensions.Clear(); chart1.Import(FileFormat.Binary, "D:\\Temp\\StatisticalExport.bin"); Link to comment Share on other sites More sharing options...
FP2006 Posted January 8, 2008 Author Report Share Posted January 8, 2008 Have you had an opportunity to look into this? Thanks in advance. Link to comment Share on other sites More sharing options...
FP2006 Posted January 10, 2008 Author Report Share Posted January 10, 2008 Should I be opening a support ticket on this issue or is the forum the right way to go? Thanks again for the help. Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.