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

How do the parameters work?

edited December 2008 in End User
Report Builder for Delphi 2007, Professional Edition, 10.07

We are trying to use Report Builder to print invoices. The invoice reports
is externally saved from report builder, and the report explorer contains
the database. What we would like to do is launch the report from another
delphi application, pass the transaction number to the report, and show the
report, in this case, an invoice.

We can pass a value to the autosearch dialog, but we would like to have it
select the record automatically, without user input.

We can also pass the value to a parameter, but the documentation does not
explain how to access the parameter within the report.

Previously, this was done by having a report component within the
originating application, but editing is only available to the developers.
We are looking for more flexiiblity, and have other reports in mind for
which we would like to pass information.

Thanks in advance for your help.

Donald

Comments

  • edited December 2008

    There are two main approaches to implementing this.

    1. Use Autosearch parameters.

    myReport.ShowAutoSearchDialog := False;
    myReport.AutoSearchFields[0].SearchExpression := 'SomeValue';
    myReport.AutoSearchFields[0].ShowAllValues := False; // optional

    myReport.Print;


    2. Report Parameters/SQLBuilder

    Define a Report Parameter and then use TdaSQLBuilder to modify the search
    criteria in the Report.OnInitializeParameters event.

    To access Report.Parameters via code

    a. Delphi code

    myReport.Parameters['ParamName'].Value := 'some value';

    b. RAP code is a litlte simpler

    Report.Parameters['ParamName'] := 'some value';

    Here is an example of using SQLBuilder to modify the search criterai

    http://www.digital-metaphors.com/rbWiki/DADE/SQLBuilder/How_To_Modify_Search_Criteria


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

    Best regards,

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