Home End User

Setting the Sql-Where and Sql-OrderBy in a Template

edited February 2003 in End User
Hi Cracks,

we've got prepared Reports, wich are saved in a Database as a template. Now
we want to open them and setting a individual Where and OrderBy Command.
How???

The actual commands are:

ppReportExplore.LoadReport(sReport, nIdFolder);
ppReport.print;


Thanks in advance for all help provided here.

Regards,
Helmut Auffinger

Comments

  • edited February 2003
    The first way is to use the runtime report designer to visually edit the
    dataviews in each report, using the Query Designer. This is available in
    the Professional and Enterprise editions of ReportBuilder. Use the Report
    Explorer as shown in the End User Databases demos in the RBuilder
    installation to open and save the templates on the database.

    If you want to edit the templates in code, rather than in the runtime
    designer, then there is a way. Here is an example which shows how to change
    the templates data access definitions at runtime:

    http://www.digital-metaphors.com/tips/ExtractSQLObject.zip


    Cheers,

    Jim Bennett
    Digital Metaphors


  • edited February 2003
    Hello Jim Bennet,

    I used your Function "GetSQLObject(aReport: TppCustomReport; var aSQL:
    TdaSQL): Boolean;"
    and with aSQL I continued

    aSQL.EditSQLAsText := true;
    aSQL.MagicSQLText.add(sWhere);
    aSQL.MagicSQLText.add(sOrderBy);

    // sWhere, sOrderBy are Strings and comes from outside.

    Thanks a lot for the rapid help,

    Helmut Auffinger.
This discussion has been closed.