How to add a table to query building area programmatically
In some situations I have only1 table in the metadata tree. I'd like that table be added to the query building area programmatically and not to make user to drag it there.
In some situations I have only1 table in the metadata tree. I'd like that table be added to the query building area programmatically and not to make user to drag it there.
Dear Helen,
Thank you for your question.
There are four methods that can help you with this:
QueryBuilder.ActiveSubQuery.ActiveUnionSubQuery.AddObject
QueryBuilder.ActiveSubQuery.ActiveUnionSubQuery.AddObjectAt
QueryBuilder.ActiveSubQuery.ActiveUnionSubQuery.AddObjectWithFK
QueryBuilder.ActiveSubQuery.ActiveUnionSubQuery.AddObjectWithFKAt
Methods with the "At" should be used when dragging objects to the Design Pane as they allow to specify position to add object at. Methods with the "WithFK" suffix instruct the component to add joins to the newly added object from other objects that may exist in the active sub-query (according to the foreign keys or by identical field names (CreateLinksByIdenticalFieldNames, CreateLinksFromForeignKeys).
Dear Helen,
Also note that in the case of adding tables to the query programmatically, you may not need the Design Pane at all. You can hide it using the QueryBuilder.PanesConfigurationOptions.DesignPaneVisible property. Also, you might be interested in this article as well: Working without the Design Pane