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

Adding criteria manually to a report

edited August 2004 in End User
I have created a general end-user report which I have saved as a .rtm file.
Later I can load this report and manually add filter criteria based on
selections by the user before printing the report. I'm doing this by
extracting the tdaSQL object and using the built-in methods
AvailableCriteriaList and SelectCriteria. Now it looks like I need to
change the setup of this report by manually editing the sql. Once I do that
it appears that AvailableCriteriaList returns nothing. Does this procedure
look at the data dictionary and if you manually edit the sql it doesn't find
anything? How can I manually add criteria on queries built by hand?

Michael Gregg

Comments

  • edited August 2004

    ----------------------------------------------
    Tech Tip: Limitations of using TdaSQL.SQLText
    ----------------------------------------------

    The TdaSQL object can contain either an object based description of the SQL
    (SelectTables[], SelectFields[], etc.) that it uses to generate SQLText OR
    it contain a SQLText string. If you specify the SQLText string then TdaSQL
    will not generate any SQLText. Therefore the built-in AutoSearch and Linking
    features can no longer be used - because these require that special SQLText
    be generated.

    If you want to use AutoSearch with a SQLText, you will need to handle this
    in your custom dataview code. For an example see RBuilder\Demos\AutoSearch
    and see the TdaQueryDataView.CreateAutoSearchFields and
    TdaQueryDataView.ReportGetAutoSearchValuesEvent methods in
    daQueryDataView.pas.



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



    Best regards,

    Nard Moseley
    Digital Metaphors
    www.digital-metaphors.com
  • edited August 2004
    So can I just manually change the sql in SQLText? There is a Text property
    that contains the entire sql string and also a Strings property that looks
    like an array of the lines of sql. What's the best way to change it? Just
    alter the entire sql and put it back in Text?

    Michael Gregg


  • edited August 2004

    example:

    mySQL.EditSQLAsText := True;
    mySQL.SQLText.Text := 'select * from clients';



    --


    Best regards,

    Nard Moseley
    Digital Metaphors
    www.digital-metaphors.com
This discussion has been closed.