Jump to content
Software FX Community

Personalization and AJAX


Sharath

Recommended Posts

Hi,

I'm trying to understand Personalization feature and AJAX in Chartfx for VS2005 with render format as .Net. 

I downloaded your zip file CfxAjax.zip from http://support.softwarefx.com/ShowArticleSep.aspx?Type=KB&Product=CfxNet70&Source=http://support.softwarefx.com/kb/765/1/001.htm and Ajax works great.

To render the chart in .Net format, I added the attribute RenderFormat=".Net", no issues works great.

To include Auto save and Auto load feature I modified this line <chartfx7:Chart ID="Chart1" runat="server" Height="442px" Width="590px" RenderFormat=".Net" Personalize-Name="dummyx_10" Personalize-AutoLoad="True"  Personalize-AutoSave="True" OnUserCommand="Chart1_UserCommand" OnClick="Chart1_Click" OnUserCallback="Chart1_UserCallback">

Question 1: Now If right click the chart, change the color,  close the browser and reopen the same page no problem the savings are preserved and works fine but instead of closing the browser If I click the refresh button it breaks throwing out unhandled exception. Is this a bug? Are there any work around instead of closing the browser ?

 On further exploring I added UseClientLoader="True" to make the page faster. It did made a difference both to the speed and auto saving.

Question 2: With UseClientLoader="True" It looks like I dont have to close the browser to preserve my savings. Refreshing the browser works fine. Is this a feature of useclientloader ?

Question 3: I'm unable to save the Title got thru AJAX ("Fire UserCallback" button) and also it removes any existing changes made on client side(example color).  Scenario 1:  I changed the color of the chart to blue and on adding the title the color of the chart is reset to default color. Scenario 2: I added the title and changed the color of chart to blue. On refreshing the chart the blue color persists but not the title. How can I save title added thru AJAX, This is an important feature as I'm planning to provide the user to add multiple Y axis on the fly thru AJAX.

Any help is highly appreciated and thanks for your time in advance.

- Sharath

 

Link to comment
Share on other sites

> Question 1:

I could not reproduce the crash you described when doing refresh I tried all combinations of UseClientLoader (on/off), and AxCompat (On/Off). But I never got the crash. I am using IE 7. What OS/Browser are you using? What version of Chart FX? Make sure you have the latest Service Pack.

> Question2:

This is not intended, AutoLoad/AutoSave should work with or without the Client Loader. Using the Client Loader is recommended though since, like you already noticed, it speeds up the downloading of the control. The only drawback to Client Loader is that you can not trap Client-Side events.

> Question 3:

The title text is not part of the settings saved in personalization, you can change this though:

chart1.TemplateContents |= FileContents.Titles | FileContents.TitlesText;

You may want to add other contents as well.

As for the callback, you need to do a few things for the client control to work with callback events:

- Set UseCallbackForEvent = true- Your .NET Trust level in the client must be set to full trust. This is needed in order for the .NET Client Control to interact with the DOM and insert its own data in it.

It is nice to see how you are taking full advantage of Chart FX's AJAX capabilities.

Link to comment
Share on other sites

Hi Frank,

Thanks for your reply but I still could not resolve both the issues. 

> Question 1: I have tried this on two machines, one with Windows 2000 professional and IE 6. The second one is XP Professional and IE 7. Also I made sure to grant full trust for Intranet Connection at machine level. Still no luck it is crashing in both machines.

Here are the steps that led it to crash.

Set RenderFormat as .Net, UseClientLoader - set to false, Personalized Name - Give a new name(every time the code is changed I'll give it a new name to ignore previous savings), Autoload and AutoSave - set to true

Open a new browser window and type the URL.

After the chart is displayed. Right click and change the color.

Click on refresh button

IE will try to load the page and when the chart is getting loaded it throws unhandled exception "Object reference not set to an instance of an object"

Here is the error message with chartfx version number.

*********************************************************************************

See the end of this message for details on invoking

just-in-time (JIT) debugging instead of this dialog box.

 

************** Exception Text **************

System.NullReferenceException: Object reference not set to an instance of an object.

at ChartFX.NetIEClient.GlobalAttributes.a(Boolean A_0, IPersistBase A_1)

at ChartFX.NetIEClient.a1.a(String A_0, Object A_1, String A_2, ObjFlags A_3, Int64 A_4)

at ChartFX.NetIEClient.a1.a(String A_0, Object A_1, String A_2, ObjFlags A_3)

at ChartFX.NetIEClient.Chart.e(Boolean A_0, IPersistBase A_1, Boolean A_2)

at ChartFX.NetIEClient.Chart.Import(FileFormat format, Stream stream)

at ChartFX.NetIEClient.PersonalizeAttributes.Load()

at ChartFX.NetIEClient.a2.j()

at ChartFX.NetIEClient.Chart.a(DownloadEventArgs A_0)

at ChartFX.NetIEClient.ao.a(DownloadEventArgs A_0)

 

 

************** Loaded Assemblies **************

mscorlib

  Assembly Version: 2.0.0.0

  Win32 Version: 2.0.50727.42 (RTM.050727-4200)

  CodeBase: file:///C:/WINDOWS/Microsoft.NET/Framework/v2.0.50727/mscorlib.dll

----------------------------------------

System

  Assembly Version: 2.0.0.0

  Win32 Version: 2.0.50727.42 (RTM.050727-4200)

  CodeBase: file:///C:/WINDOWS/assembly/GAC_MSIL/System/2.0.0.0__b77a5c561934e089/System.dll

----------------------------------------

ChartFX.NetIEClient

  Assembly Version: 7.0.2540.35421

  Win32 Version: n/a

  CodeBase: http://tempreports.com/chartfx70/download/ChartFX.NetIEClient.dll

----------------------------------------

System.Windows.Forms

  Assembly Version: 2.0.0.0

  Win32 Version: 2.0.50727.42 (RTM.050727-4200)

  CodeBase: file:///C:/WINDOWS/assembly/GAC_MSIL/System.Windows.Forms/2.0.0.0__b77a5c561934e089/System.Windows.Forms.dll

----------------------------------------

ChartFX.NetIEClient.Base

  Assembly Version: 7.0.2540.35262

  Win32 Version: n/a

  CodeBase: http://tempreports.com/chartfx70/download/ChartFX.NetIEClient.Base.DLL

----------------------------------------

System.Drawing

  Assembly Version: 2.0.0.0

  Win32 Version: 2.0.50727.42 (RTM.050727-4200)

  CodeBase: file:///C:/WINDOWS/assembly/GAC_MSIL/System.Drawing/2.0.0.0__b03f5f7f11d50a3a/System.Drawing.dll

----------------------------------------

Accessibility

  Assembly Version: 2.0.0.0

  Win32 Version: 2.0.50727.42 (RTM.050727-4200)

  CodeBase: file:///C:/WINDOWS/assembly/GAC_MSIL/Accessibility/2.0.0.0__b03f5f7f11d50a3a/Accessibility.dll

----------------------------------------

ChartFX.NetIEClient.Adornments

  Assembly Version: 7.0.2540.35291

  Win32 Version: n/a

  CodeBase: http://tempreports.com/chartfx70/download/ChartFX.NetIEClient.Adornments.DLL

----------------------------------------

System.Configuration

  Assembly Version: 2.0.0.0

  Win32 Version: 2.0.50727.42 (RTM.050727-4200)

  CodeBase: file:///C:/WINDOWS/assembly/GAC_MSIL/System.Configuration/2.0.0.0__b03f5f7f11d50a3a/System.Configuration.dll

----------------------------------------

System.Xml

  Assembly Version: 2.0.0.0

  Win32 Version: 2.0.50727.42 (RTM.050727-4200)

  CodeBase: file:///C:/WINDOWS/assembly/GAC_MSIL/System.Xml/2.0.0.0__b77a5c561934e089/System.Xml.dll

----------------------------------------

System.Data

  Assembly Version: 2.0.0.0

  Win32 Version: 2.0.50727.42 (RTM.050727-4200)

  CodeBase: file:///C:/WINDOWS/assembly/GAC_32/System.Data/2.0.0.0__b77a5c561934e089/System.Data.dll

----------------------------------------

 

************** JIT Debugging **************

To enable just-in-time (JIT) debugging, the .config file for this

application or computer (machine.config) must have the

jitDebugging value set in the system.windows.forms section.

The application must also be compiled with debugging

enabled.

 

For example:

 

<configuration>

  <system.windows.forms jitDebugging="true" />

</configuration>

 

When JIT debugging is enabled, any unhandled exception

will be sent to the JIT debugger registered on the computer

rather than be handled by this dialog box.

******************************************************************************************

Can you let me know what version of chartfx you are using? and is it possible to send me the files you have used for testing?

 

Question 3>

I tried your suggestion adding the chart.TemplateContents line in page_load and in usercallback code  but it seems to be not working. Chart.TemplateContents is working if I define the title in chart object during the design time and able to provide the user the control to change or not change the title by changing the templatecontents.

Any suggestions

 

Thx

Sharath

Link to comment
Share on other sites

>Question 1

I was able to reproduce the crash with the steps provided (thank you!). I found the problem and we will fix it in the next SP. Please contact support if you wish to have a intermediate HotFix sooner.

>Question 3

This is by design. Only objects that already exist are read from the template. You can create an empty title in your Form Load as follows if you want your users to be able to create one:

if (!IsPostBack)

 chart1.Titles.Add(new TitleDockable(string.Empty)); 

Make sure you change your personalize name after this change. You can also do it at design time.

Link to comment
Share on other sites

  • 3 weeks later...

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...