Jump to content
Software FX Community

Reload Chart Data in .NET Client Control via Client-Side Script


User (Legacy)

Recommended Posts

I'm using the .NET client control in IE and rendering charts via a web 

service in the DataPath parameter. I'd like to change the parameter via

client-side script (Javascript) and re-generate the chart based on different

querystring parameters sent to the web service.

It doesn't look like the chart actually reloads, despite changing the

DataPath property:

<object id="Chart1"

classid="/chartfx62/download/ChartFX.MainClient.DLL#SoftwareFX.ChartFX.Internet.MainClient"

WIDTH="750px" HEIGHT="100%" VIEWASTEXT>

<PARAM NAME="AssemblyTarget" VALUE="ChartFX.Internet.Client,

Version=6.2.1754.19545, Culture=neutral, PublicKeyToken=a1878e2052c08dce" >

<PARAM NAME="DataPath"

VALUE="http://MyServer/MyWebservice/WebService1.asmx/GetCfxChart?data=DailyData">

<PARAM NAME="ClassTarget" VALUE="SoftwareFX.ChartFX.Internet.Client.Chart" >

</object>

(Javascript)

alert("Before: " + Chart1.DataPath)

Chart1.DataPath =

"http://MyServer/MyWebservice/WebService1.asmx/GetCfxChart?data=WeeklyData"

alert("After: " + Chart1.DataPath)

// The "After" alert msg reflects the changed value but the web service

doesn't actually get hit.

Link to comment
Share on other sites

Is the chart loading the data from the service the first time? Does ChartFX 

has full trust in the client machine you are testing?

Note that if a .net control hosted inside IE does not have full trust, it

cannot access any "fully qualified URL" other than the same server as the

page itself, e.g. if you type http://www.yourcompany.com /... in your

browser's address bar, a control with low trust can only download relative

URLs (/MyWebService/...) or fully qualified URLs that start with

http://www.yourcompany.com. Even trying to use the same IP adress that

yourcompany.com resolves to won't work without full trust.

JC

SoftwareFX Support

"Scott Grosenick" <Scottgrosenick@hotmail.com> wrote in message

news:4RqFAx0TFHA.1588@webserver3.softwarefx.com...

> I'm using the .NET client control in IE and rendering charts via a web

> service in the DataPath parameter. I'd like to change the parameter via

> client-side script (Javascript) and re-generate the chart based on

> different querystring parameters sent to the web service.

>

> It doesn't look like the chart actually reloads, despite changing the

> DataPath property:

>

> <object id="Chart1"

> classid="/chartfx62/download/ChartFX.MainClient.DLL#SoftwareFX.ChartFX.Internet.MainClient"

> WIDTH="750px" HEIGHT="100%" VIEWASTEXT>

> <PARAM NAME="AssemblyTarget" VALUE="ChartFX.Internet.Client,

> Version=6.2.1754.19545, Culture=neutral, PublicKeyToken=a1878e2052c08dce"

> >

> <PARAM NAME="DataPath"

> VALUE="http://MyServer/MyWebservice/WebService1.asmx/GetCfxChart?data=DailyData">

> <PARAM NAME="ClassTarget" VALUE="SoftwareFX.ChartFX.Internet.Client.Chart"

> >

> </object>

>

>

> (Javascript)

> alert("Before: " + Chart1.DataPath)

> Chart1.DataPath =

> "http://MyServer/MyWebservice/WebService1.asmx/GetCfxChart?data=WeeklyData"

> alert("After: " + Chart1.DataPath)

>

> // The "After" alert msg reflects the changed value but the web service

> doesn't actually get hit.

>

Link to comment
Share on other sites

  • 2 weeks later...

Yes, the chart loads the data from the service. I haven't assigned full 

trust to ChartFX but I am using a relative url. In addition, I tried turning

off code access security (caspol -s off) and still had the problem.

I'm changing the DataPath in response to the user changing the value of a

dropdown list. When that occurs, I load a bunch of other data from another

web service and change the DataPath of the chart. I see the hit in the web

log for the first web service hit but not that of the chart. (The chart data

is returned from a WS too.)

Thanks!

"Software FX Support" <none@noreply.com> wrote in message

news:5TtsFoCUFHA.2236@webserver3.softwarefx.com...

> Is the chart loading the data from the service the first time? Does

> ChartFX has full trust in the client machine you are testing?

>

> Note that if a .net control hosted inside IE does not have full trust, it

> cannot access any "fully qualified URL" other than the same server as the

> page itself, e.g. if you type http://www.yourcompany.com /... in your

> browser's address bar, a control with low trust can only download relative

> URLs (/MyWebService/...) or fully qualified URLs that start with

> http://www.yourcompany.com. Even trying to use the same IP adress that

> yourcompany.com resolves to won't work without full trust.

>

> JC

> SoftwareFX Support

>

> "Scott Grosenick" <Scottgrosenick@hotmail.com> wrote in message

> news:4RqFAx0TFHA.1588@webserver3.softwarefx.com...

>> I'm using the .NET client control in IE and rendering charts via a web

>> service in the DataPath parameter. I'd like to change the parameter via

>> client-side script (Javascript) and re-generate the chart based on

>> different querystring parameters sent to the web service.

>>

>> It doesn't look like the chart actually reloads, despite changing the

>> DataPath property:

>>

>> <object id="Chart1"

>> classid="/chartfx62/download/ChartFX.MainClient.DLL#SoftwareFX.ChartFX.Internet.MainClient"

>> WIDTH="750px" HEIGHT="100%" VIEWASTEXT>

>> <PARAM NAME="AssemblyTarget" VALUE="ChartFX.Internet.Client,

>> Version=6.2.1754.19545, Culture=neutral, PublicKeyToken=a1878e2052c08dce"

>> >

>> <PARAM NAME="DataPath"

>> VALUE="http://MyServer/MyWebservice/WebService1.asmx/GetCfxChart?data=DailyData">

>> <PARAM NAME="ClassTarget"

>> VALUE="SoftwareFX.ChartFX.Internet.Client.Chart" >

>> </object>

>>

>>

>> (Javascript)

>> alert("Before: " + Chart1.DataPath)

>> Chart1.DataPath =

>> "http://MyServer/MyWebservice/WebService1.asmx/GetCfxChart?data=WeeklyData"

>> alert("After: " + Chart1.DataPath)

>>

>> // The "After" alert msg reflects the changed value but the web service

>> doesn't actually get hit.

>>

>

>

Link to comment
Share on other sites

Any word on this? The only way I could get this to work was to put the chart 

object tag in an IFRAME and re-write the tag with a new DataPath with

document.writeln() followed by document.close() but this crashes IE 50% of

the time.

Does SoftwareFX have a sample demonstrating this behavior that I may have

missed? I'm pretty sure that I'm not doing anything wrong here - the

DataPath is relative, the initial load is successful, and I can view the

property value before + after changing it. The problem is that the chart

control never hits the web service to pull the new data.

"Scott Grosenick" <Scottgrosenick@hotmail.com> wrote in message

news:Ha67L8yVFHA.2004@webserver3.softwarefx.com...

> Yes, the chart loads the data from the service. I haven't assigned full

> trust to ChartFX but I am using a relative url. In addition, I tried

> turning off code access security (caspol -s off) and still had the

> problem.

>

> I'm changing the DataPath in response to the user changing the value of a

> dropdown list. When that occurs, I load a bunch of other data from another

> web service and change the DataPath of the chart. I see the hit in the web

> log for the first web service hit but not that of the chart. (The chart

> data is returned from a WS too.)

>

> Thanks!

>

>

> "Software FX Support" <none@noreply.com> wrote in message

> news:5TtsFoCUFHA.2236@webserver3.softwarefx.com...

>> Is the chart loading the data from the service the first time? Does

>> ChartFX has full trust in the client machine you are testing?

>>

>> Note that if a .net control hosted inside IE does not have full trust, it

>> cannot access any "fully qualified URL" other than the same server as the

>> page itself, e.g. if you type http://www.yourcompany.com /... in your

>> browser's address bar, a control with low trust can only download

>> relative URLs (/MyWebService/...) or fully qualified URLs that start with

>> http://www.yourcompany.com. Even trying to use the same IP adress that

>> yourcompany.com resolves to won't work without full trust.

>>

>> JC

>> SoftwareFX Support

>>

>> "Scott Grosenick" <Scottgrosenick@hotmail.com> wrote in message

>> news:4RqFAx0TFHA.1588@webserver3.softwarefx.com...

>>> I'm using the .NET client control in IE and rendering charts via a web

>>> service in the DataPath parameter. I'd like to change the parameter via

>>> client-side script (Javascript) and re-generate the chart based on

>>> different querystring parameters sent to the web service.

>>>

>>> It doesn't look like the chart actually reloads, despite changing the

>>> DataPath property:

>>>

>>> <object id="Chart1"

>>> classid="/chartfx62/download/ChartFX.MainClient.DLL#SoftwareFX.ChartFX.Internet.MainClient"

>>> WIDTH="750px" HEIGHT="100%" VIEWASTEXT>

>>> <PARAM NAME="AssemblyTarget" VALUE="ChartFX.Internet.Client,

>>> Version=6.2.1754.19545, Culture=neutral,

>>> PublicKeyToken=a1878e2052c08dce" >

>>> <PARAM NAME="DataPath"

>>> VALUE="http://MyServer/MyWebservice/WebService1.asmx/GetCfxChart?data=DailyData">

>>> <PARAM NAME="ClassTarget"

>>> VALUE="SoftwareFX.ChartFX.Internet.Client.Chart" >

>>> </object>

>>>

>>>

>>> (Javascript)

>>> alert("Before: " + Chart1.DataPath)

>>> Chart1.DataPath =

>>> "http://MyServer/MyWebservice/WebService1.asmx/GetCfxChart?data=WeeklyData"

>>> alert("After: " + Chart1.DataPath)

>>>

>>> // The "After" alert msg reflects the changed value but the web service

>>> doesn't actually get hit.

>>>

>>

>>

>

>

Link to comment
Share on other sites

You are using MainClient which is good as it offers improved performance 

over using the .net client control directly but you seem to be hitting a bug

when you set the MainClient's DataPath property through code.

Note that MainClient exposes the chart as a property (named Chart) so you

can workaround this issue by using this property. Also note that when

setting the DataPath property as a relative URL we will only add the domain

part to the URL so in the following test, the DataPath.htm is in the Cfx62

folder but I am still setting DataPath to "/cfx62/ChartData.aspx". If you

set DataPath using a fully qualified URL, it will work (without full trust)

as a long as you use the same domain as the page that contains the chart.

DataPath.htm

<html>

<body>

<object id="Chart1"

classid="/chartfx62/download/ChartFX.MainClient.DLL#SoftwareFX.ChartFX.Internet.MainClient"

WIDTH="400px" HEIGHT="400px" >

<PARAM NAME="DataPath" VALUE="/CfxTemp/CFT0518_10234121DCD.chw">

<PARAM NAME="AssemblyTarget" VALUE="ChartFX.Internet.Client,

Version=6.2.XXXXXX, Culture=neutral" >

<PARAM NAME="ClassTarget" VALUE="SoftwareFX.ChartFX.Internet.Client.Chart" >

</object>

<script type="text/javascript">

function updateChart()

{

Chart1.Chart.DataPath = '/cfx62/ChartData.aspx';

}

</script>

<a href="javascript:updateChart()">Click Here</a>

</body>

</html>

CharData.aspx

<%@ Page Language="C#"%>

<%@ Import Namespace="System.Drawing" %>

<%

SoftwareFX.ChartFX.Internet.Server.Chart chart1 = new

SoftwareFX.ChartFX.Internet.Server.Chart(this);

chart1.Gallery = SoftwareFX.ChartFX.Gallery.Lines;

chart1.Series[0].Color = Color.Red;

chart1.Series[0].Gallery = SoftwareFX.ChartFX.Gallery.Bar;

chart1.GetHtmlData(300,320,".net");

%>

"Scott Grosenick" <Scottgrosenick@hotmail.com> wrote in message

news:s1zCa8vWFHA.2608@webserver3.softwarefx.com...

> Any word on this? The only way I could get this to work was to put the

> chart object tag in an IFRAME and re-write the tag with a new DataPath

> with document.writeln() followed by document.close() but this crashes IE

> 50% of the time.

>

> Does SoftwareFX have a sample demonstrating this behavior that I may have

> missed? I'm pretty sure that I'm not doing anything wrong here - the

> DataPath is relative, the initial load is successful, and I can view the

> property value before + after changing it. The problem is that the chart

> control never hits the web service to pull the new data.

>

>

> "Scott Grosenick" <Scottgrosenick@hotmail.com> wrote in message

> news:Ha67L8yVFHA.2004@webserver3.softwarefx.com...

>> Yes, the chart loads the data from the service. I haven't assigned full

>> trust to ChartFX but I am using a relative url. In addition, I tried

>> turning off code access security (caspol -s off) and still had the

>> problem.

>>

>> I'm changing the DataPath in response to the user changing the value of a

>> dropdown list. When that occurs, I load a bunch of other data from

>> another web service and change the DataPath of the chart. I see the hit

>> in the web log for the first web service hit but not that of the chart.

>> (The chart data is returned from a WS too.)

>>

>> Thanks!

>>

>>

>> "Software FX Support" <none@noreply.com> wrote in message

>> news:5TtsFoCUFHA.2236@webserver3.softwarefx.com...

>>> Is the chart loading the data from the service the first time? Does

>>> ChartFX has full trust in the client machine you are testing?

>>>

>>> Note that if a .net control hosted inside IE does not have full trust,

>>> it cannot access any "fully qualified URL" other than the same server as

>>> the page itself, e.g. if you type http://www.yourcompany.com /... in

>>> your browser's address bar, a control with low trust can only download

>>> relative URLs (/MyWebService/...) or fully qualified URLs that start

>>> with http://www.yourcompany.com. Even trying to use the same IP adress

>>> that yourcompany.com resolves to won't work without full trust.

>>>

>>> JC

>>> SoftwareFX Support

>>>

>>> "Scott Grosenick" <Scottgrosenick@hotmail.com> wrote in message

>>> news:4RqFAx0TFHA.1588@webserver3.softwarefx.com...

>>>> I'm using the .NET client control in IE and rendering charts via a

>>>> web service in the DataPath parameter. I'd like to change the parameter

>>>> via client-side script (Javascript) and re-generate the chart based on

>>>> different querystring parameters sent to the web service.

>>>>

>>>> It doesn't look like the chart actually reloads, despite changing the

>>>> DataPath property:

>>>>

>>>> <object id="Chart1"

>>>> classid="/chartfx62/download/ChartFX.MainClient.DLL#SoftwareFX.ChartFX.Internet.MainClient"

>>>> WIDTH="750px" HEIGHT="100%" VIEWASTEXT>

>>>> <PARAM NAME="AssemblyTarget" VALUE="ChartFX.Internet.Client,

>>>> Version=6.2.1754.19545, Culture=neutral,

>>>> PublicKeyToken=a1878e2052c08dce" >

>>>> <PARAM NAME="DataPath"

>>>> VALUE="http://MyServer/MyWebservice/WebService1.asmx/GetCfxChart?data=DailyData">

>>>> <PARAM NAME="ClassTarget"

>>>> VALUE="SoftwareFX.ChartFX.Internet.Client.Chart" >

>>>> </object>

>>>>

>>>>

>>>> (Javascript)

>>>> alert("Before: " + Chart1.DataPath)

>>>> Chart1.DataPath =

>>>> "http://MyServer/MyWebservice/WebService1.asmx/GetCfxChart?data=WeeklyData"

>>>> alert("After: " + Chart1.DataPath)

>>>>

>>>> // The "After" alert msg reflects the changed value but the web service

>>>> doesn't actually get hit.

>>>>

>>>

>>>

>>

>>

>

>

Link to comment
Share on other sites

Archived

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

×
×
  • Create New...