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

Custom dataviews 2

edited November 2001 in General
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?

Comments

  • edited November 2001
    DADE supports creating a self join (join on the same table) and then sort by
    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


  • edited November 2001
    I tried this and the SQL is correct, but it still does not print correctly on
    the report

  • edited November 2001
    Can you give some more specific info about the other tables involved in you
    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


  • edited November 2001
    I will attempt to make a demo and send it to you.

This discussion has been closed.