Jump to content
Software FX Community

chart does not load if render format is .NET control


divyesh29
 Share

Recommended Posts

Hi All,<?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" />

i have created interactiveChart.aspx which contains chart control and i am embedding interactiveChart.aspx into report.aspx by creating place holder for chart and using javascript.

now my problem is if chart render format is image then chart is visible in report.aspx but if chart render format is .NET then chart is not visible.

one more thing is that if i run interactiveChart.aspx directly(without embedding into report.aspx) then chart is visible with .NET render format..

any idea what is going on and how can i solve the problem??

pls, reply as soon as possible!!!

Divyesh

Mcube. 

Link to comment
Share on other sites

hi

i am posting demo code. if u can suggest how this demo code will work fine then i will do the same changes in my original code.( i can not post original code due to company policies)

default.aspx : this page contains code to generate chart. here  i creating just a default chart which comes by default when we drag and drop chart object on page

code:

<

asp:Panel ID="ControlPanel" runat="server" Height="50px" Width="125px">

<%-- Default Chart --%>

<chartfx7:Chart ID="Chart1" runat="server" RenderFormat=".NET">

<Series>

<chartfx7:SeriesAttributes />

<chartfx7:SeriesAttributes />

<chartfx7:SeriesAttributes />

</Series>

</chartfx7:Chart></asp:Panel>

Report.aspx : this page work as startup page. this page calls javascript method (DisplayChart) on load event which in turns calls default.aspx for chart generation. 

code:

<html xmlns="http://www.w3.org/1999/xhtml" >

<

head runat="server">

<title>Untitled Page</title><script language="javascript" src="./chart.js"></script>

</

head>

<%-- Call to DisplayChart method (present in chart.js) on onload event of page --%>

<BODY bgColor="#ffffff" leftMargin="0" topMargin="0" marginheight="0" marginwidth="0" onload="javascript:DisplayChart();">

<form id="form1" runat="server">

<div>

Default Chart

<table>

<tr>

<td width="100%" colSpan="2" align="center">

<%-- creation of place holder for chart --%>

<div id="placeHolder">

</div>

</td>

</tr>

</table>

</div></form>

</

body>

</

html>

chart.js : this file contais DisplayChart method, which calls CreateChartForOneRow method, which will call defaul.aspx for chart. after geting reply from default.aspx, reply will be parsed by getfile method and responseText will added to innerHTML of place holder available in report.aspx

function DisplayChart()

{

 

//Chart div is accesseddisplayObjArea = "";

 

displayObjArea = document.getElementById("placeHolder");  //getting place holder element from report.aspx

 

if(displayObjArea != null && displayObjArea != "")

{

chartSectionDiv = document.createElement("div");  //creating chart sectionif(chartSectionDiv != null || chartSectionDiv != undefined)

{

chartSectionDiv.id =

"chartDiv";tableObj = document.createElement("TABLE"); //creating table for chart

 

tableBody = CreateChartForOneRow(); // calling CreateChartForOneRow for table body

 

tableObj.appendChild(tableBody); // attaching table body to table

chartSectionDiv.appendChild(tableObj); // attaching table to chart section

 

displayObjArea.appendChild(chartSectionDiv); //attaching chart section to place holder

 

 

}

}

}

 

function CreateChartForOneRow()

{

var tableBody = document.createElement("TBODY"); // creating table body for chart

var trObj = "";var tdObj = "";

trObj = document.createElement(

"TR"); // chart rowtrObj.setAttribute('align', 'center');

tdObj = document.createElement(

"TD"); // chart columntdObj.setAttribute('align', 'center');

 

tdObj.id = "ChartTD";

tdObj.url =

"default.aspx"; // calling default.aspx for charttdObj.ChartAttach = "1";

str = getFile(tdObj.url); // call to getFile to parse the response

tdObj.innerHTML = str; //attaching reponse to table

if (tdObj.captureEvents)

tdObj.captureEvents(Event.CLICK)

trObj.appendChild(tdObj); // attaching td to tr

 

tableBody.appendChild(trObj); // attaching tr to table body

 

return tableBody;

}

function getFile(filename)

{

oxmlhttp = null;

try{ oxmlhttp = new XMLHttpRequest();oxmlhttp.overrideMimeType("text/xml");

}

catch(e)

{

try{ oxmlhttp = new ActiveXObject("Msxml2.XMLHTTP");

}

catch(e)

{

return null;

}

}

if(!oxmlhttp) return null;

try{oxmlhttp.open("GET",filename,false);oxmlhttp.send(null);

}

catch(e){ return null;

}

return oxmlhttp.responseText;

}

when i am running this demo project chart is coming if its rendered as image but if chart is rendered as .NET then chart is not coming.

i am following same flow in main project so if things works here it will work in main project also.

Thanks

Divyesh

Mcube

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

×
×
  • Create New...