Text Lines Truncated in Multi-Page Report MemoView within MasterData Band

Hello,

I'm using FastReport FMX for Delphi FireMonkey XE5 and I have a problem populating a Text Object (i.e. a MemoView) with the items of a ListBox.

Following gordk's directions, I used a MasterData Band, without assigning any dataset. I set its RowCount property to 1, the Stretch and AllowSplit properties to True and, finally, the MemoView Stretch mode to smMaxHeight.

Now, when the items on the ListBox in FireMonkey are few and can be contained in a single FastReport Page, everything goes fine. Nevertheless, when their number increases and a new page is created, the last three items do not appear on Page 2 of the FastReport Report. If the number of items increases even further, then the last six items do not appear on Page 3 of the FastReport Report, and so forth.

The code I use in FireMonkey to populate the FastReport MemoView is the following:
procedure TfrmMyReport.btnPrintClick(Sender: TObject);
  var
   Memo : TfrxMemoView;
   i: Integer;
begin

  Memo := frxReport.FindObject('txtReportTitle') as TfrxMemoView;
  Memo.Text := 'List of Contacts';

  Memo := frxReport.FindObject('txtReport') as TfrxMemoView;

  Memo.Text := '';

  for i := 0 to lstRecords.Items.Count -1 do
    begin
      Memo.Text := Memo.Text + lstRecords.Items[i];
    end;

  frxReport.PrepareReport;
  frxReport.Print;

end;

Should I set any additional properties to any different values in order to prevent the lines in the MemoView object from being truncated on the last page? Or is it the MasterData Band that gets shorter and shorter and hides the last lines in the MemoView increasingly?

To me, it looks like the MasterData Band is unable to stretch to exactly the same height as the MemoView from Page 2 onwards. Particularly, page after page, the height of the MasterData Band becomes three lines shorter than the size it should be. In other words, it does not expand sufficiently to fit the entire content of the MemoView.

So, my question is, how can I prevent the MasterData Band from getting shorter and shorter in order to show all of the lines contained in the MemoView?

Any help will be greatly appreciated.

Thanks in advance.

Comments

  • gpigpi
    edited 10:56PM
    Attach your report template here
  • edited 10:56PM
    gpi wrote: »
    Attach your report template here

    Please find attached my report template and a PDF file that will show you what you get on paper after printing the report.

    I would like to remind you that I'm using Delphi FireMonkey XE5. In order to reproduce the bug, you can do the following:

    (1) In FireMonkey XE5, place a ListBox on a Form, name it lstRecords and populate it by using the following code in the FormShow event:
    procedure TfrmReport.FormShow(Sender: TObject);
      var
      i : integer;
    begin
    
      for i := 1 to 200 do
        begin
          lstRecords.Items.Add('Line ' + IntToStr(i));
        end;
    
    end;
    

    (2) Place a FastReport control onto the Form, double click on it and create a template like the attached one.

    (3) After saving the FastReport template, go back to the FireMonkey Form, place a button on it, name it btnPrint and insert the following code in the Click event:
    procedure TfrmReport.btnPrintClick(Sender: TObject);
     var
       Memo : TfrxMemoView;
       i: Integer;
    begin
    
      Memo := frxReport.FindObject('txtReportTitle') as TfrxMemoView;
      Memo.Text := 'List of Contacts';
    
      Memo := frxReport.FindObject('txtReport') as TfrxMemoView;
    
      Memo.Text := '';
    
      for i := 0 to lstRecords.Items.Count -1 do
        begin
          Memo.Text := Memo.Text + lstRecords.Items[i];
        end;
    
      frxReport.PrepareReport;
      frxReport.Print;
    
    end;
    

    Compile the FireMonkey application, run it and then print out the report by clicking on the button. You will see that the printed copy of the FastReport report will not show the last 3 items (Line 198, Line 199 and Line 200).

    Thanks in advance for your help.

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.