Page 1 of 1

Loading chart from blob field

Posted: Fri Sep 09, 2005 8:47 pm
by 9238256
I have a Delphi 7 utility that creates thousands of charts and loads them into a database. This "loader" utility utilizes TDBChart to make the chart, then I save to a file of type ".Tee" (Native) The .tee file is then loaded into a BLOB field in an Interbase database (Interbase: Just like Oracle only better). I now am building a "reader" utility that will display the charts that were built and stored previously. My question is this:

What is the best way to display the stored .tee charts?

1) TBlobField.SaveToFile(xxx.tee), then somehow load the .tee file into the TDBChart? (How do I do this?)

2) TBlobField.SaveToStream() then somehow load the TDBChart via a stream? (How do I do this?)

I need actual code snippets.

Thanks for any help you can provide.

Posted: Fri Sep 09, 2005 10:05 pm
by 9238256
I have figured out the syntax for loading a chart from a blob field by using a TMemoryStream and LoadChartFromStream(). However, I keep getting the message: "Wrong *.tee file format".

A TDBChart was used to create the chart, then I saved to a .tee file using SaveChartToFile(), then I loaded the resultant file into a Blob field.

In the "reader" utility, I simply load the TDBChart from a stream that was "SavedTo" by the blob field.

What am I doing wrong?

-- sorry for posting in the wrong forum.

Posted: Fri Sep 09, 2005 10:32 pm
by 9238256
Solved it. I just need to set Stream1.Position := 0 before reading from it. Sorry to bug you guys and gals.

Posted: Mon Sep 12, 2005 8:53 am
by narcis
Hi C.H. Luke,

I'm glad to hear you could solve your problem. However, we would appreciate that whenever you have any other TeeChart issue you posted it to the TeeChart VCL forums as this forum is for TeeTree VCL inquiries.

Thanks in advance.