TagStr property for TfrxMasterData

edited October 26 in FastReport VCL

Why doesn't TfrxMasterData have a TagStr property?

Unfortunately, because that would easily solve my problem.


Actually, I would like to know on which page or in which MasterData instance of the preview which dataset is displayed in order to be able to read a certain field from the dataset there.


Unfortunately, it was not possible for me to get an assignment to the dataset record from frxReport1.PreviewPages.Page[i].AllObjects or to be able to read its values.

E.g. with TfrxMasterData all index values ​​are 0 or useless (because they are the same everywhere), DataSet is nil and VirtualDataSet has RecordCount=0.


A value can be returned in the TagStr for a TfrxMemoView or TfrxBarCodeView. [WorkSql."esl_barcode"]

But since this is supposed to be a general feature, I don't know what will be on the report. A TfrxMasterData is definitely on it, but I can't use variables anywhere there. (manually in FastScript is not practical)

Searching everything else on each page or below the masterrecord would work, but isn't that unnecessarily cumbersome?



usually one page per dataset-record

but e.g. in case of alignment errors


--- Page 0 ---

TfrxNullBand

TfrxMasterData MasterData1

TfrxMemoView Memo2

TfrxMemoView Memo3

TfrxBarCodeView BarCode1

TfrxMemoView Memo4

TfrxMemoView Memo5

--- Page 1 ---

TfrxMasterData MasterData1

TfrxBarcode2DView Barcode2D1

--- Page 2 ---

TfrxMasterData MasterData1

TfrxMemoView Memo2

TfrxMemoView Memo3

TfrxBarCodeView BarCode1

TfrxMemoView Memo4

TfrxMemoView Memo5

--- Page 3 ---

TfrxMasterData MasterData1

TfrxBarcode2DView Barcode2D1

for i := 0 to frxReport1.PreviewPages.Count - 1 do begin
 OutputDebugString(PChar('--- ' + IntToStr(i) + ' ----------------------------------'));
 OutputDebugString(PChar(frxReport1.PreviewPages.Page[i].DataSet.SecureClassName + ' ' + frxReport1.PreviewPages.Page[i].DataSet.SecureName));
 for P in frxReport1.PreviewPages.Page[i].AllObjects do begin
   OutputDebugString(PChar(TObject(P).SecureClassName + ' ' + TComponent(P).SecureName));
   if TObject(P) is TfrxMemoView then
     OutputDebugString(PChar(' tag ' + TfrxMemoView(P).TagStr)); // super
   if TObject(P) is TfrxMasterData then begin
     //OutputDebugString(PChar(' tag ' + TfrxMasterData(P).TagStr)); // not exists
     OutputDebugString(PChar(' cnt ' + IntToStr(TfrxMasterData(P).VirtualDataSet.RecordCount))); // 0
     OutputDebugString(PChar(' fld ' + TfrxMasterData(P).VirtualDataSet.Fields.CommaText)); // empty
     OutputDebugString(PChar(' bar ' + VarToStr(TfrxMasterData(P).VirtualDataSet.Value['rem_barcode']))); // empty
   end;
 end;
end;


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.