load tee from asp.net response

TeeChart for ActiveX, COM and ASP
Post Reply
FranzThomsen
Newbie
Newbie
Posts: 3
Joined: Wed Mar 01, 2006 12:00 am

load tee from asp.net response

Post by FranzThomsen » Mon Dec 18, 2006 11:28 am

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

FranzThomsen
Newbie
Newbie
Posts: 3
Joined: Wed Mar 01, 2006 12:00 am

works fine with latest 7.0

Post by FranzThomsen » Tue Dec 19, 2006 2:38 pm

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));

Post Reply