Webchart problems in Delphi2005

TeeChart for Microsoft Visual Studio .NET, Xamarin Studio (Android, iOS & Forms) & Monodevelop.
Post Reply
Hans
Newbie
Newbie
Posts: 15
Joined: Mon Jun 20, 2005 4:00 am

Webchart problems in Delphi2005

Post by Hans » Thu Feb 16, 2006 6:10 pm

I tried to get webchart working in Delphi2005. I think we have to rewrite the Getchart.aspx.cs into Delphi.

private void Page_Load(object sender, System.EventArgs e)
{
string chartName=Request.QueryString["Chart"];
if (Session[chartName]!=null)
{
MemoryStream chartStream = new MemoryStream();
chartStream=((MemoryStream)Session[chartName]);
Response.OutputStream.Write(chartStream.ToArray(),0,(int)chartStream.Length);
chartStream.Close();
Session.Remove(chartName);
}
}

Is someone able to translate it into Delphi language?

It should like :

procedure TGetchart.Page_Load(sender: System.Object; e: System.EventArgs);
Var Chartname : String;
ChartStream : Memorystream;
begin
chartName:=Request.QueryString['Chart'];
if (Session[chartName]=nil) then begin
Chartstream:=Memorystream.Create;
Chartstream.Read(Session[chartName]);
Response.OutputStream.Write(chartStream.ToArray), 0,chartStream.Length);
chartStream.Close;
end;
Session.Remove(chartName);
end;

But the chartstream lines are wrong.

Thanks,
Hans

Narcís
Site Admin
Site Admin
Posts: 14730
Joined: Mon Jun 09, 2003 4:00 am
Location: Banyoles, Catalonia
Contact:

Post by Narcís » Fri Feb 17, 2006 11:15 am

Hi Hans,

This is the GetChart code in Delphi:

Code: Select all

procedure TWebForm2.Page_Load(sender: System.Object; e: System.EventArgs);
var
  chartName: String;
  chartStream: MemoryStream;
begin
  chartName := Request.QueryString['Chart'];
  if (Session[chartName] <> nil) then
  begin
    chartStream := System.IO.MemoryStream.Create;
    chartStream := (System.IO.MemoryStream(Session[chartName]));
    Response.OutputStream.Write(chartStream.ToArray, 0, (Integer(chartStream.Length)));
    chartStream.Close;
    Session.Remove(chartName);
  end;
end;
In those cases, it may be of great help using Borland’s BabelCode Client.
Best Regards,
Narcís Calvet / Development & Support
Steema Software
Avinguda Montilivi 33, 17003 Girona, Catalonia
Tel: 34 972 218 797
http://www.steema.com
Image Image Image Image Image Image
Instructions - How to post in this forum

Post Reply