Custom dataviews 2
I have a problem with a custom dataview I am working on. I am
opening a schools table twice. Once for home school and then once
for the opponents. The problem is that when I want to sort by the
opponent school, the report writer only looks at the field name to
generate the SQL and so it always gets the schools.school name field
to sort instead of the opponents.schoolname field. I was able to get
the sql.sqltext.text to have the correct field by not using your
getfieldforsqlfield name and by looping thru the fields myself.
However this still does not sort the file properly. I can take the
sql and run it in database explorer and get the correct results. Is
there a way around this?
opening a schools table twice. Once for home school and then once
for the opponents. The problem is that when I want to sort by the
opponent school, the report writer only looks at the field name to
generate the SQL and so it always gets the schools.school name field
to sort instead of the opponents.schoolname field. I was able to get
the sql.sqltext.text to have the correct field by not using your
getfieldforsqlfield name and by looping thru the fields myself.
However this still does not sort the file properly. I can take the
sql and run it in database explorer and get the correct results. Is
there a way around this?
This discussion has been closed.
Comments
the second table's field name. DADE does this by creating an alias. All of
the possible ORDER BY fields which haven't been added as an ORDER BY, will
be in the TdaSQL.AvailableOrderByFields list. You can pull it out and add
it manually by calling the TdaSQL.SelectOrderByField() method where you pass
the index of the desired field in AvailableOrderByFields[]. Find the field
by calling TdaSQL.FindAvailableOrderByField(TableName, FieldName).
If the SQL is correct, then the records will be passed from the datapipeline
to the report in the order they are in the dataset.
Cheers,
Jim Bennett
Digital Metaphors
http://www.digital-metaphors.com
info@digital-metaphors.com
the report
data structure? I'm not sure how to reproduce the problem. Can you sample
some data and send me a working report project that shows this?
support@digital-metaphors.com I'm interested in seeing the SQL and how/why
the report prints as you describe. Thanks.
Cheers,
Jim Bennett
Digital Metaphors
http://www.digital-metaphors.com
info@digital-metaphors.com