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

Opening EU Reports

edited July 2003 in End User
I have designed quite a few reports for my clients via the EU reporting I
setup in the application. Everything is fine there but how do I open those
reports dynamically from the application? How would I set the autosearch
criteria when doing this?

Comments

  • edited July 2003
    You can load them by calling Report.Template.LoadFromDatabase. Be sure to
    configure the Report.Template.Datasettings property first so that it can
    find the database table.


    Cheers,

    Jim Bennett
    Digital Metaphors


  • edited July 2003
    Thank You !!!

    How would I set the autosearch values dynamically and prevent the
    autosearch dialog from appearing?

  • edited July 2003
    Johnson John wrote:


    We this code for printing forms in our applications-

    procedure PrintForm(FormName:string;IDvalue:integer);
    begin
    frmforms := Tfrmforms.create(application);
    with frmForms do
    begin
    SearchCriteria := inttostr(idvalue);
    ppreport.template.DatabaseSettings.Name := Formname;
    ppreport.template.LoadFromDatabase;
    ppreport.OnPreviewFormCreate := FrmFORMS.CreatePreview;
    try
    ppreport.Print;
    Except // wrap up
    ShowMessage('Form Not Found');
    end;
    end; // with
    frmforms.Free;
    frmforms := nil;
    end;

    That procedure allows us to call the printform() from anywhere in our
    app and we just tell it what form we want to print and what value we
    want to set (in our case it's always an ID number for a sales order,
    Bill of Material, etc).

    Then we set the value in the BeforeAutoSearchDialog (as shown below).
    lastly, we tell it to NOT show the autosearch dialog.

    procedure TFrmFORMS.ppReportBeforeAutoSearchDialogCreate(
    Sender: TObject);
    begin
    ppReport.AutoSearchFields[0].SearchExpression := SearchCriteria;
    if not istesting then
    ppreport.showAutoSearchDialog := False;
    end;

    Hope that helps.

    Chris
  • edited July 2003
    That helped a lot !!
    Thank You

This discussion has been closed.