How to remove/deselect tables at runtime...
Hi,
I'm converting some saved reports (RTM files) after moving some database
fields from one table to another. This means I have to effectively remove
three tables from the report template. I am currently looping over the
report objects and changing the Fieldname and Tablename properties of the
field components so the design layout info will be updated.
But how to I update the query information? I have code to retrieve the SQL
object, and now I want to remove three of the tables that may be selected
for this report. I tried calling RemoveTable but it didn't work. I thought
DeselectTable might work, but the parameter is a table index which I don't
know how to get.
I'm kind of floundering now. What would be the best way to "deselect" the
tables from the report now that those tables will no longer exist in the
database? Do I do this as part of the SQL object or is it stored elsewhere?
Any help in this regard would be greatly appreciated.
Thanks,
Vinnie Murdico
I'm converting some saved reports (RTM files) after moving some database
fields from one table to another. This means I have to effectively remove
three tables from the report template. I am currently looping over the
report objects and changing the Fieldname and Tablename properties of the
field components so the design layout info will be updated.
But how to I update the query information? I have code to retrieve the SQL
object, and now I want to remove three of the tables that may be selected
for this report. I tried calling RemoveTable but it didn't work. I thought
DeselectTable might work, but the parameter is a table index which I don't
know how to get.
I'm kind of floundering now. What would be the best way to "deselect" the
tables from the report now that those tables will no longer exist in the
database? Do I do this as part of the SQL object or is it stored elsewhere?
Any help in this regard would be greatly appreciated.
Thanks,
Vinnie Murdico
This discussion has been closed.
Comments
don't want to rip out tables that other tables are joined to.) The
'TableIndex' simply refers to the position of the table in the SelectTables
array property. Deselecting the last three tables:
for liIndex :=0 to 2 do
lSQL.DeselectTable(lSQL.SelectTableCount - 1);
To find a given table:
liIndex := lSQL.IndexOfTableAlias('myTableAliasFromDataDictionary');
if (liIndex = -1) then
{table not found}
Cheers,
Tom Ollar
Digital Metaphors Corporation
http://www.digital-metaphors.com
info@digital-metaphors.com