Recent

Author Topic: fpreport: can not use two ObjectLists as datasource in one report  (Read 1287 times)

af0815

  • Hero Member
  • *****
  • Posts: 1291
I have a sample included witch show the problem.

I want in the report (created a runtime) to use more than one report datasource. I create a databand and connect this with a TFPReportObjectListData object. Each TFPReportObjectListData object works. But i want to have the data of the first, then the data of the other object. But i am not able to combine this two Data in one Report.

Code: Pascal  [Select][+][-]
  1.   DataBand := TFPReportDataBand.Create(p);
  2.   DataBand.Name:= 'DBBand01';
  3.   DataBand.Layout.Height := 10;
  4.   DataBand.Data:= lReportOLData1;   // First Data !!!!! This is shown
  5.  
  6.   Memo := TFPReportMemo.Create(DataBand);
  7.   Memo.Layout.Left := 5;
  8.   Memo.Layout.Top := 0;
  9.   Memo.Layout.Width := 60;
  10.   Memo.Layout.Height := 5;
  11.   Memo.Font.Name := defaultFont;
  12.   Memo.Text := '[InfoA] - [ValueA]';
  13.  
  14.  
  15.   DataBand2 := TFPReportDataBand.Create(p);
  16.   DataBand2.Name:= 'DBBand02';
  17.   DataBand2.Layout.Height := 10;
  18.   DataBand2.Data:= lReportOLData2;   // Second Data !!!!! This is not shown
  19.  
  20.   Memo2 := TFPReportMemo.Create(DataBand2);
  21.   Memo2.Layout.Left := 5;
  22.   Memo2.Layout.Top := 0;
  23.   Memo2.Layout.Width := 60;
  24.   Memo2.Layout.Height := 5;
  25.   Memo2.Font.Name := defaultFont;
  26.   Memo2.Text := '[InfoB] - [ValueB]';
  27.  

Any Hint for this problem to solve ?
regards
Andreas

af0815

  • Hero Member
  • *****
  • Posts: 1291
Re: fpreport: can not use two ObjectLists as datasource in one report
« Reply #1 on: March 19, 2021, 02:00:25 pm »
Quote
On Fri, 19 Mar 2021, Michael Van Canneyt via fpc-pascal wrote:
> On Fri, 19 Mar 2021, Andreas Frieß via fpc-pascal wrote:
>
>> Make a Report Preview -> only the contend of the first dataset is shown.
>>
>> I will file a bug
>
> No need, because this is as designed.
>
For clarity: it's as designed, but that doesn't mean I won't consider
changing the design. Just don't report it as a bug, because it is not.

Michael.

FPReport cannot handle more than one dataset per page without a master detail relationship. LazReport have no such problem with it.

FPReport is only a very limited reportingtool (i see now) and for more complex reports (i mean only more than one dataset !! per page !!) useless. Use LazReport or a other good reportingtool instead.

Limitation are by design. .... No more words.
regards
Andreas

 

TinyPortal © 2005-2018