Problem importing map shp/dbf
Yes, it works.
Maybe the problem can be the resource compiler that I'm using... I'm using BRCC32 in the borland delphi 7 \bin directory, are you using something other??
However i have also loaded the map from resource with loadmap function, but the problem is linking with dbf, because if I set the dataset property (changing the TChart in TDBChart) after have loaded the map, the series resets all the values and the shapes disappear.
With loadmap function is all automated, so, how can i connect my datasource?
Many thanks
Manuel
Maybe the problem can be the resource compiler that I'm using... I'm using BRCC32 in the borland delphi 7 \bin directory, are you using something other??
However i have also loaded the map from resource with loadmap function, but the problem is linking with dbf, because if I set the dataset property (changing the TChart in TDBChart) after have loaded the map, the series resets all the values and the shapes disappear.
With loadmap function is all automated, so, how can i connect my datasource?
Many thanks
Manuel
Hi Manuel,
I've used the same BRCC32 ( the one inside \bin dirctory ), just ad the -32 parameter to allow to use it directly throught the IDE.
About the datasource linking, please take a look at the TeeMaps demo source which does the same you're looking for (and it uses the code I show you). You will see that just before to call the LoadFromResource method it tries to load the data from dbf.
I've used the same BRCC32 ( the one inside \bin dirctory ), just ad the -32 parameter to allow to use it directly throught the IDE.
About the datasource linking, please take a look at the TeeMaps demo source which does the same you're looking for (and it uses the code I show you). You will see that just before to call the LoadFromResource method it tries to load the data from dbf.
Pep Jorge
http://support.steema.com
http://support.steema.com
sorry, i have tryed the TeeMaps demo on your site and also the one in my steema soft directory, and no one load the dbf.
they configure and open open the table with the dbf, but nothing is done to the series.
Infact the data in the series1 is all incorrect and the name of the country isn't loaded (obviously checking the load from dbf checkbox)
seeking in the source code there is only this code referred to the dbf
this open only the table1 component with the dbf file, but doesn't link it to the series..
am I loosing something?
they configure and open open the table with the dbf, but nothing is done to the series.
Infact the data in the series1 is all incorrect and the name of the country isn't loaded (obviously checking the load from dbf checkbox)
seeking in the source code there is only this code referred to the dbf
Code: Select all
procedure TryLoadTable;
var tmp : String;
begin
tmp:=ChangeFileExt(ComboFlat1.Text,'.dbf');
if FileExists(tmp) then
begin
Table1.Close;
Table1.DatabaseName:=ExtractFilePath(tmp);
Table1.TableName:=ExtractFileName(tmp);
Table1.Open;
Table1.First;
end;
end;
am I loosing something?
Hi Manuel,
I'm sorry, I'm not sure what you mean, there's a booleanparameter into the LoadMap which allows to decide if you wanto to clear the Series when it's called.
I've just sent the TeeShp.pas file just in case you want to check how works the LoadMap and it's posibilities.
I'm sorry, I'm not sure what you mean, there's a booleanparameter into the LoadMap which allows to decide if you wanto to clear the Series when it's called.
I've just sent the TeeShp.pas file just in case you want to check how works the LoadMap and it's posibilities.
Pep Jorge
http://support.steema.com
http://support.steema.com
Ok, i have seen how LoadMap works and now it's all more clear.
But what I'm saying is that in the demo of TeeMap the load of the dbf value doesn't work, because the demo call
TryLoadTable
and after
LoadMap that is this
so if I'm right in the demo the DBF isn't loaded in the series1 but only in the Table1, that isn't used as DataSource in Series1, so nothing is loaded.
tomorrow i will try 16 and 32 bit resource, because now (in Italy it's 18 pm) I must go home.
I will update you soon
Many thanks
Manuel
But what I'm saying is that in the demo of TeeMap the load of the dbf value doesn't work, because the demo call
TryLoadTable
and after
LoadMap that is this
Code: Select all
procedure LoadMap;
begin
case ComboFlat1.ItemIndex of
0: TWorldSeries.LoadMapFromResource(Series1,'TeeWorldShp','TeeWorldShx');
1: TWorldSeries.LoadMapFromResource(Series1,'TeeUSAStatesShp','TeeUSAStatesShx');
else
TWorldSeries.LoadMapFromResource(Series1,'TeeSpainShp','TeeSpainShx');
end;
end;
tomorrow i will try 16 and 32 bit resource, because now (in Italy it's 18 pm) I must go home.
I will update you soon
Many thanks
Manuel
Hi Manuel,
yes, you're correct, the table is loaded but not linked to any Series, I'm not sure why we leaved as is, we'll take revise for the next maintenance.
yes, you're correct, the table is loaded but not linked to any Series, I'm not sure why we leaved as is, we'll take revise for the next maintenance.
Ok, here in Spain we have the same time.tomorrow i will try 16 and 32 bit resource, because now (in Italy it's 18 pm) I must go home.
I will update you soon
Pep Jorge
http://support.steema.com
http://support.steema.com
but i can't figure how to connect the database (dbf) in your example maps.zip, after the LoadFromResource call.
I have tried to set the DataSource value to my ClientDataSet, to add it with Datasources.Add but all this things clear all value in my series1
What am I missing?
In Bar series all this things works (after setting the YValues.ValueSource to the field values name), but in Map series setting only ZValues.ValuesSource nothing change.
Can you give me an example?
Many thanks
I have tried to set the DataSource value to my ClientDataSet, to add it with Datasources.Add but all this things clear all value in my series1
What am I missing?
In Bar series all this things works (after setting the YValues.ValueSource to the field values name), but in Map series setting only ZValues.ValuesSource nothing change.
Can you give me an example?
Many thanks
Hi Manuel,
I'm afraid there's not a way to merge the data from the DataSource (dataset) and resource file directly ( by using the LoadFromResource call ), only the LoadMap method does.
In case you want to use the LoadFromResource method, to update (or add) the Label values to the Series created and populated you should iterate through the dataset and setting the values manually. Similar code to this could be used :
I'm afraid there's not a way to merge the data from the DataSource (dataset) and resource file directly ( by using the LoadFromResource call ), only the LoadMap method does.
In case you want to use the LoadFromResource method, to update (or add) the Label values to the Series created and populated you should iterate through the dataset and setting the values manually. Similar code to this could be used :
Code: Select all
while not Table1.Eof do
begin
Series1.XLabel[i] := Table1.FieldValues['NAME'];
...
table1.Next;
end;
Pep Jorge
http://support.steema.com
http://support.steema.com
ok, this is not a bad solution, but the main problem is:
DBF contain 239 record
Series1 contain near 1000 record...
how can i link these data???
the loadmap do itself...
i will try to take the code from loadmap and modify to load with resource, hope to find the solution
many thanks for now, i will update you soon
DBF contain 239 record
Series1 contain near 1000 record...
how can i link these data???
the loadmap do itself...
i will try to take the code from loadmap and modify to load with resource, hope to find the solution
many thanks for now, i will update you soon
Yes, one way would be to use the same code as the one used into the TeeShp.pas file for LoadMap method.
how can i link these data???
the loadmap do itself...
i will try to take the code from loadmap and modify to load with resource, hope to find the solution
Pep Jorge
http://support.steema.com
http://support.steema.com