Page 1 of 1

load tee from asp.net response

Posted: Mon Dec 18, 2006 11:28 am
by 9090495
Hi

I have an ASP.NET page in which in the codebehind use the TeeChart 6.0.0.6 to set up a chart. What I can do now is to save the tee file with SaveToFile and then have the client side javascript pick up the tee file with LoadFromURL. The main problem with this is that the file is then stored on the harddisk on the server with whatever problems this can give when multible users try to create and access the same file. I am therefore trying to handle the problem in another way. I have successfully done this when the putput is a png image:

// Weird nature of png requires a save to mem first
MemoryStream MemStream = new MemoryStream((byte[])chart.Export.asPNG.SaveToStream());
Response.ContentType = "image/png";
MemStream.WriteTo(Response.OutputStream);

Then in the page where I have the image I can set the src to the aspx page producing the above response.

I am looking for a similar way to produce a Response.OutputStream with the binary "tee" output and the client side code that will make the TeeChart ActiveX request and load this stream.

Best regards
Franz Thomsen

works fine with latest 7.0

Posted: Tue Dec 19, 2006 2:38 pm
by 9090495
client side:
document.getElementById("TChart1").Import.LoadFromURL("http://localhost/dss/Default2.aspx");

serverside
TChartClass chart = new TChartClass();
chart.Import.LoadFromFile(@"C:\Inetpub\wwwroot\UserFiles\TeeChart.tee");
Response.BinaryWrite((byte[])chart.Export.asNative.SaveToStream(true));