List index out of bounds when right-clicking empty part of report page designer

With FastReport VCL version 6.1.16, in the designer, when I right-click an empty part of a report page (or a dialog page, or the Data tab), when no other objects are selected, I get a "List index out of bounds (0)" error. I can see the error is occurring on this line in TfrxDesignerForm.PagePopupPopup, because FSelectedObjects has no items in it:

AddChildMI.Visible := (TObject(FSelectedObjects[0]) is TfrxBand) and
not (TObject(FSelectedObjects[0]) is TfrxColumnFooter) and
not (TObject(FSelectedObjects[0]) is TfrxOverlay);

In the previous version we were using, 5.4.1, right-clicking an empty part of a report page in the designer would open the menu with just the "Edit" option available, which opened the Page Options form.

The error doesn't occur if I right-click within the left or top margin of the report page in the designer. We can see when we left-click an empty part of the report designer, that the font toolbar clears/disables and the drop-down list of report components clears, as if FastReport thinks nothing is selected, but when we left-click within the left or top margin, it "selects" the TfrxReportPage. In 5.4.1, left-clicking on any empty part of the report page designer would "select" the TfrxReportPage, and you could even double-click to open the Page Options form.

So we can work-around the problem by right-clicking the left or top margin to get to the page's Edit option to open the Page Options form, but this is a bug that should be fixed.

Comments

  • gpigpi
    edited 8:01PM
    Modify frxDesgnWorkspace.pas:
    c := FLastObjectOver;///TfrxComponent(FObjects[i]);
    if (c is TfrxComponent) and c.IsContain(X / Scale, Y / Scale) then
      begin
        EmptySpace := (c is TfrxPage); //change this line
    

Leave a Comment

Rich Text Editor. To edit a paragraph's style, hit tab to get to the paragraph menu. From there you will be able to pick one style. Nothing defaults to paragraph. An inline formatting menu will show up when you select text. Hit tab to get into that menu. Some elements, such as rich link embeds, images, loading indicators, and error messages may get inserted into the editor. You may navigate to these using the arrow keys inside of the editor and delete them with the delete or backspace key.