I am having great success getting TeeChart to cooperate, but now have problem I need some help with. I have a dynamic query that can result in a variety of columns using my Delphi 7 app. I don't instantiate the fields in the datamodule, to allow it to accept a variety of columns. If I instantiate the columns I need for the graph, then I leave behind columns that my user may want. If I instantiate all of them, then I lose my advantage of speedy custom searches.
I tried instantiating the ones I needed long enough to get it running, but If I delete them from the query object afterwards the program won't compile.
Any ideas?
Non-instaniated fields
-
- Site Admin
- Posts: 14730
- Joined: Mon Jun 09, 2003 4:00 am
- Location: Banyoles, Catalonia
- Contact:
Hi CAC,
Have you also deleted all references to removed ones? Which compilation error do you get?
Thanks in advance.
Have you also deleted all references to removed ones? Which compilation error do you get?
Thanks in advance.
Best Regards,
Narcís Calvet / Development & Support Steema Software Avinguda Montilivi 33, 17003 Girona, Catalonia Tel: 34 972 218 797 http://www.steema.com |
Instructions - How to post in this forum |
This is the piece of code that gives me a problem:
if I don't have the fields instantiated, then I get an error like this:with dm.qryLResults do
begin
DisableControls;
try
First;
while not(EOF) do
Begin
if dm.qryLResultsSAMPLE_NAME.AsString = SampleName then
if dm.qryLResultsANALYTE.AsString = AnalyteName then
begin
SampleSeries.AddXY(dm.qryLResultsSAMPLE_DATE.AsDateTime, dm.qryLResultsRESULT.AsFloat);
end;
Next;
end;
finally
EnableControls;
end;
thanks[Error] AnalyticalGraph.pas(192): Undeclared identifier: 'qryLResultsSAMPLE_NAME'
-
- Site Admin
- Posts: 14730
- Joined: Mon Jun 09, 2003 4:00 am
- Location: Banyoles, Catalonia
- Contact:
Hi CAC,
Before the if statement you could try checking the number of fields in dm or loop through them to check if fields with given names exists.
Before the if statement you could try checking the number of fields in dm or loop through them to check if fields with given names exists.
Best Regards,
Narcís Calvet / Development & Support Steema Software Avinguda Montilivi 33, 17003 Girona, Catalonia Tel: 34 972 218 797 http://www.steema.com |
Instructions - How to post in this forum |
I know these columns of data will exist at run time, because the dynamic query in my code is set to run a specific list of key columns. The "catch" is assigning these columns to TeeChart at design time so I can compile the program. It appears that if I instantiate one column, I have to instantiate them all, which defeats the purpose.
One option I have thought of is running two queries, my dynamic query (which will fill grids, and reports), and a second one with the columns needed for the graph already instaniated in a TIBOQuery object.
One option I have thought of is running two queries, my dynamic query (which will fill grids, and reports), and a second one with the columns needed for the graph already instaniated in a TIBOQuery object.