Saving and Loading Chart from file problems (Please help)

TeeChart VCL for Borland/CodeGear/Embarcadero RAD Studio, Delphi and C++ Builder.
Post Reply
thr4sh3r
Newbie
Newbie
Posts: 9
Joined: Tue May 09, 2006 12:00 am

Saving and Loading Chart from file problems (Please help)

Post by thr4sh3r » Tue Jul 11, 2006 11:39 am

Hi.

I am having a problem Saving and Loading charts from file.
Here are the 2 procedures:

procedure TfrMain.GraphSaveClick(Sender: TObject);
begin
GraphName := PopupMenuGraph.PopupComponent.Name;
frSave.Show;
end;

procedure TfrMain.GraphOpenClick(Sender: TObject);
var tmpChart:TCustomChart;
File_name: String;
begin
GraphName := PopupMenuGraph.PopupComponent.Name;
For Search := 1 to 40 do
Begin
If GraphName = Graph[Search].Name then
Begin
Found := Search;
Break;
end;
end;
frOpen.Showmodal;
Graph[Found].Free;
tmpChart:=TChart.Create(Self);
File_name := saveUnit.File_name + '.tee';
LoadChartfromFile(tmpChart,File_name);
Graph[Found] := tmpChart as TChart;
Graph[Found].Parent := Page1;
end;

And the other 2:

procedure TfrOpen.btnAcceptClick(Sender: TObject);
begin
File_name := Filelistbox1.Directory + '\' + Filenameedit.Text;
File_name2 := Filelistbox1.Directory + '\';
frOpen.Close;
Closed := false;
end;

procedure TfrSave.btnAcceptClick(Sender: TObject);
var Search, Found: integer;
begin
File_name := Filelistbox1.Directory + '\' + Filenameedit.Text;
File_name2 := Filelistbox1.Directory + '\';
For Search := 1 to 40 do
Begin
If GraphName = Graph[Search].Name then
Begin
Found := Search;
Break;
end;
end;
SaveChartToFile(Graph[Found],File_name,True);
frSave.Close;
Closed := false;
end;

Hope it makes sense. Ask if it doesnt. It doesnt work though. And ive tried everything. :/

Thanks in advance.

Regards
Justin aka thr4sh3r

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

Post by Narcís » Tue Jul 11, 2006 11:50 am

Hi Justin,

Which are the exact problems you are having? Maybe reading this other thread may help you solving them, specially including TeeEditPro unit.
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

thr4sh3r
Newbie
Newbie
Posts: 9
Joined: Tue May 09, 2006 12:00 am

Post by thr4sh3r » Tue Jul 11, 2006 12:22 pm

Thank you Narcís.

That was so simple, why wasnt it included in the Help/Manual?
Would of saved me a lot of time.

Works perfectly now. :)

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

Post by Narcís » Tue Jul 11, 2006 12:52 pm

Hi Justin,

You're welcome. I'm glad to hear that solved your issue.

BTW: This is already included in the features demo examples :wink: .
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