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

Missing 'New...' and 'New Report' Menu Items from designer

edited June 2002 in General
Our application contains a reports explorer available in a 'read-only'
mode for everyday users and a 'reports generator' mode for system
administrators. We use the code below to toggle the reports editing
facility.

Our users have reported a strange error. If they open the app and run the
explorer in 'read-only' mode first, then later run the reports generator the
'new..' and 'new report' items are missing from the reports designer when
the 'Design' tab is active (though not when the 'data' tab is active!).
However, if they run the 'reports generator' first
then the report explorer in 'read only' mode, then the 'reports generator'
again everything is fine. Are we forgetting to
toggle an option back on in the code below?




procedure TfrmGrindersMenu.LaunchReportsGenerator;
begin

frmCadReportExplorer.ppReportExplorer1.FolderOptions :=
frmCadReportExplorer.ppReportExplorer1.FolderOptions +[foAllowNew,
foAllowDelete, foAllowRename, foAllowMove];
frmCadReportExplorer.ppReportExplorer1.ItemOptions :=
frmCadReportExplorer.ppReportExplorer1.ItemOptions + [ioAllowDesign,
ioAllowNew, ioAllowDelete, ioAllowRename, ioAllowMove];
frmCadReportExplorer.ppReportExplorer1.ItemAction := iaOpenToDesign;
frmCadReportExplorer.ShowModal;
end;

procedure TfrmGrindersMenu.LaunchReportsExplorer;
begin

frmCadReportExplorer.ppReportExplorer1.FolderOptions :=
frmCadReportExplorer.ppReportExplorer1.FolderOptions -[foAllowNew,
foAllowDelete, foAllowRename, foAllowMove];
frmCadReportExplorer.ppReportExplorer1.ItemOptions :=
frmCadReportExplorer.ppReportExplorer1.ItemOptions - [ioAllowDesign,
ioAllowNew, ioAllowDelete, ioAllowRename, ioAllowMove];
frmCadReportExplorer.ppReportExplorer1.ItemAction := iaOpenToPreview;
frmCadReportExplorer.ShowModal;
end;


Best regards,

Mike Walters

Comments

  • edited June 2002
    This is happening because the second time the designer runs it doesn't know
    that settings have changed and that it need to reinitialize itself. Add the
    following line to the each of the two methods below before calling ShowModal
    to force it to reinitialize.

    frmCadReportExplorer.ppReportExplorer1.Initialized := False;
    --
    Cheers,

    Alexander Kramnik
    Digital Metaphors

This discussion has been closed.