How to modify the text before preview in my report

hello,
i want to modify the text shown which from a database before preview,such as if the total num is not null then i will show "total num:....",if the total num is null,then the text object will empty,all these will be done before the preview?
i can do something like these before print,but not preview,who can help me?

Comments

  • ShivanShivan Germany
    edited 9:50AM
    I have the same problem. I solved it more or less good with scripting by setting the height of the Memo:

    OnBeforePrint of the Memo:
    procedure memLine2OnBeforePrint(Sender: TfrxComponent);
    begin
           if <Rechnungsposition."GuestName"> = '' then
           begin
             memLine2.Height := 0;
           end else
           begin
             memLine2.Height := 0.50;
           end;
    end;
    

    It's not very nice, but it works... maybe there's a better solution?
  • edited 9:50AM
    thanks.but what i ask if before the preview,not before the print?
    whether before preview is the same as the before print?i do not think so?
    thanks again.
  • ShivanShivan Germany
    edited 9:50AM
    if you're talking about the print preview, then yes, it won't be "visible"...

    Btw. I think there's another solution, too.
    in the OnGetData event --> set the component to invisible. (memo.visible := false)
    But I didn't try this yet.
  • foxfox
    edited 9:50AM
    Maybe this helps ...
    {
      This example shows a way to hide Barcode after userselection in main programm.
      I have two TfrxMasterData, one assigned to a not used subreport.
      So I can change the parent of TfrxBarCodeView like following ... 
    }
    procedure TrepList.BarcodeOn(ShowIt:boolean);
    var bc: TfrxBarCodeView;
        md: TfrxMasterData;
    begin
      bc:=frxReport1.FindObject('Barcode1') as TfrxBarCodeView;  
      if bc<>nil 
      then begin
        if ShowIt 
        then begin
          md:=frxReport1.FindObject('MyUsedMaster') as TfrxMasterData;
          bc.parent:=md
        end
        else begin
          md:=frxReport1.FindObject('MyHiddenMaster') as TfrxMasterData;
          bc.parent:=md
        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.