ReportExplorer - DataSettings Dialog
Hello all,
I am trying to use custom Report Explorer. I've added buttons (on the
toolbar of the RepExplorer) which displays query wizard.
I want to use button which will display data settings dialog (available from
data panel and file menu of the report designer). I cannot get it to work
properly, somehow I get access violation and other error messages. Can
anyone help here.
Many Thanks.
Mirza
I am trying to use custom Report Explorer. I've added buttons (on the
toolbar of the RepExplorer) which displays query wizard.
I want to use button which will display data settings dialog (available from
data panel and file menu of the report designer). I cannot get it to work
properly, somehow I get access violation and other error messages. Can
anyone help here.
Many Thanks.
Mirza
This discussion has been closed.
Comments
{---------------------------------------------------------------------------
---}
{ TdaDataManager.DisplayDataSettingsDialog }
procedure TdaDataManager.DisplayDataSettingsDialog;
var
lDataSettingsDlg: TppCustomDataSettingsDialog;
lFormClass: TFormClass;
begin
if (FDataModule = nil) then Exit;
lFormClass := ppGetFormClass(TppCustomDataSettingsDialog);
lDataSettingsDlg :=
TppCustomDataSettingsDialog(lFormClass.Create(Application));
lDataSettingsDlg.DataModule := FDataModule;
lDataSettingsDlg.LanguageIndex := FCurrentReport.LanguageIndex;
lDataSettingsDlg.DataSettings := FWizardManager.DataSettings;
lDataSettingsDlg.ShowModal;
lDataSettingsDlg.Free;
end; {procedure, DisplayDataSettingsDialog}
You'll need to assign the datamodule of the current report, which can be
found by calling
uses daDataModule;
procedure DoIt;
var
lDataModule: TdaDataModule;
begin
...
lDataModule := daGetDataModule(ppReport1);
...
lDataSettingsDialog.Datamodule := lDataModule;
...
..
.
You'll then have to set the Datasettings object from the report designer
object, to the lDataSettingsDlg.Datasettings.
Cheers,
Jim Bennett
Digital Metaphors
http://www.digital-metaphors.com
info@digital-metaphors.com
However, I did try to follow the code that you suggested, but when dialog is
active there is nothing in combo - boxes. When clicked OK access violation
error message displays.
This is the code that I am using:
{-------------------------------------------------------------------------}
uses daDatMan, daDataModule, ppForms, daDataSettingDlg, ppDsgnDB;
var
lDataModule: TdaDataModule;
lDataSettingsDlg: TppCustomDataSettingsDialog;
lFormClass: TFormClass;
begin
lDataModule := daGetDataModule(ppReport1);
if (lDataModule=nil) then Exit;
lFormClass := ppGetFormClass(TppCustomDataSettingsDialog);
lDataSettingsDlg:=TppCustomDataSettingsDialog(lFormClass.Create(Application)
);
lDataSettingsDlg.DataModule := lDataModule;
lDataSettingsDlg.LanguageIndex := ppReport1.LanguageIndex;
lDataSettingsDlg.ShowModal;
lDataSettingsDlg.Free;
end;
{-------------------------------------------------------------------------}
I am out of the ideas, so please help.
Cheers,
Mirza
report designer. When you create a new dataview in a report, it should use
the datasettings as they were configured in the datasettings dialog.
http://www.digital-metaphors.com/tips/ShowDataSettingsDlg.zip
Cheers,
Jim Bennett
Digital Metaphors
http://www.digital-metaphors.com
info@digital-metaphors.com