Home General
New Blog Posts: Merging Reports - Part 1 and Part 2

daField.Alias -> ppField.FieldAlias

edited April 2007 in General
I have a built a custom made query editor. When I save the query, all
information seems to be persisted okay except for aliases.

If I create a query and rename fields (TdaField.FieldAlias) and save it,
then the query's window on the Data tab (and when designing reports) shows
the wrong names. When opening the query editor again to re-edit the query,
it shows the correct (ie. user edited) field names.

So what seems to be happening is that TppField.FieldAlias is getting its
value from TdaField.Alias instead of TdaField.FieldAlias. Is that right?

A cutdown example...

object Activity_Type: TppChildDBPipeline
object ppField1: TppField
FieldAlias = 'Description'
FieldName = 'DESCRIPTION'
TableName = 'ACTIVITY_TYPE'
end
object ppField2: TppField
FieldAlias = 'Description (2)'
FieldName = 'DESCRIPTION_2'
TableName = 'ACTIVITY_TYPE_2'
end
end
object daSQL1: TdaSQL
object daField1: TdaField
Alias = 'Description'
FieldAlias = 'Desc1'
FieldName = 'DESCRIPTION'
SQLFieldName = 'DESCRIPTION'
TableSQLAlias = 'ACTIVITY_TYPE'
end
object daField2: TdaField
Alias = 'Description (2)'
FieldAlias = 'Desc2'
FieldName = 'DESCRIPTION'
SQLFieldName = 'DESCRIPTION_2'
TableSQLAlias = 'ACTIVITY_TYPE_2'
end
end

How do I get "Desc2" into ppField1.FieldAlias so that Desc1 shows up in
other parts of the application instead of "Description (2)"?

Comments

  • edited April 2007
    Sorry, I meant...

    How do I get "Desc2" into ppField2.FieldAlias so that "Desc2" shows up in
    other parts of the application instead of "Description (2)"?
  • edited April 2007


    Correct. Check out daQueryDataView.pas, the method SQLToDataView calls
    CreateField. The CreateField method creates a TppField and assigns
    properties from the TdaField.

    TdaSQL ----> QueryDataView
    TdaField DBPipeline
    TppFields


    --
    Nard Moseley
    Digital Metaphors
    www.digital-metaphors.com

    Best regards,

    Nard Moseley
    Digital Metaphors
    www.digital-metaphors.com
  • edited April 2007
    Thanks. Precicely what I was looking for.
This discussion has been closed.