Using Query Wizard without displaying ppDesigner form
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?
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?
This discussion has been closed.
Comments
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
http://www.digital-metaphors.com
info@digital-metaphors.com
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
http://www.digital-metaphors.com
info@digital-metaphors.com