Home End User

Using Query Wizard without displaying ppDesigner form

edited May 2003 in End User
Hi,

I want to use the Query Wizard to generate a query and then store it. At a
later stage I want to retrieve the query and use it to generate a report.
Throughout this process I don't want to display the ppDesigner form.

I've managed to create and show the QueryWizardDialog, but it only contains
a blank panel with OK/ Cancel/ Next/ Back buttons

Any ideas?

Andr?

Comments

  • edited May 2003
    We don't have an example of launching the query wizard, but here is an
    example of launching the query designer in code.

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

    Also, you may want to look in our source to see how we create the wizard in
    DADE. Look in daDataWizardManager.pas for the
    TdaDataWizardManager.NewDataView public method.

    Cheers,

    Jim Bennett
    Digital Metaphors


  • edited May 2003
    I deleted your post as it had an attachment and we got one to
    support@digital-metaphors.com to use.

    The problem is that you need to perform the preview yourself by checking
    NextAction after the dialog is closed. Here I just did a ShowMessage:

    procedure TForm1.Button2Click(Sender: TObject);
    var
    lDialog: TdaQueryWizardDialog;
    begin

    lDialog := TdaQueryWizardDialog.Create(Application);

    try
    lDialog.SQLClass := TdaSQL;
    lDialog.SQL.Assign(FSQL);

    lDialog.Initialize;


    {show form}
    if (lDialog.ShowModal = mrOK) then
    begin
    FSQL.Assign(lDialog.SQL);

    Memo1.Lines.AddStrings(lDialog.SQL.SQLText);

    if (lDialog.NextAction = ppnaPreview) then
    ShowMessage('Report Preview');

    end;

    finally
    lDialog.Free;
    end;

    end;

    Cheers,

    Jim Bennett
    Digital Metaphors


This discussion has been closed.