Printing RichView on PageFooter

Leo BidiLeo Bidi Montevideo, Uruguay
edited 3:44AM in FastReport VCL 5
Hi everybody.

I have a report on a thermal printer with this bands.

- Report Title
- PageHeader
- Header
- MasterData
- Footer
- PageFooter

In the Pagefooter I have a frxRichView component with may or not be printable according to the user.

But when the user sets to not print the richView or its empty, I want not also to print or modify pagefooter height so my reporte becomes smaller
and save paper.

How can I do this ??

Many thanks.

Leo

Comments

  • Leo BidiLeo Bidi Montevideo, Uruguay
    edited 3:44AM
    Hi, all.

    This is the code I have in the PrintPage event of my Report component.
    var
        Memo : TfrxMemoView;
        nPage : TfrxPageFooter;
    
    begin
    
        inherited;
    
        RichView := TfrxRichView( Page.FindObject('Rich1') );
        nPage    := TfrxPageFooter( Page.FindObject('PageFooter') );
    
        if CopyNo = 1 then
        begin
            if RichView <> nil then
            begin
               RichView.Printable := True;
               nPage.Height   := 2.98;
            end
            else
            begin
                RichView.Printable := False;
                nPage.Height := 0.5;   <------ this has no effect  :blink: 
            end
        else
        begin
            nPage.Height := 0.5;
            nPage.PrintOnLastPage := False;
            if RichView <> nil then
                RichView.Printable := False;
        end;
    end;
    

    As you may see, I have in the report a pagefooter with a rich component which I only want to print in the first copy and its is in the report.
    But in the second copy I want to cut the size of the report to print less paper and the size it is the size of the page footer. It is only
    necesary to print on the first copy.

    Can this be done ?

    Thanks.


  • Leo BidiLeo Bidi Montevideo, Uruguay
    edited 3:44AM
    No one can answer this ?? Please !!!!
  • gpigpi
    edited 3:44AM
    FR's engine doesn't allow to change PageFooter height during preparing of report, place TfrxRichView on TfrxChild band and show it by Engine.ShowBand in the report script when you need
  • Leo BidiLeo Bidi Montevideo, Uruguay
    edited 3:44AM
    Thanks so much gpi. Will try to do that.
  • couponadocouponado United States
    edited 3:44AM
    This code helped me too! Thanks
    Couponado
  • Leo BidiLeo Bidi Montevideo, Uruguay
    edited 3:44AM
    Hi gpi, thanks again for you tip. Its almost works perfect as my client wants but still got a little issue.

    I put the rich component on another band instead of the footer and have a variable that tells the report to or not print it.

    The problem is that when the rich has not to be print, the band wether it is, its no printed as I want, but when the rich has to be printed,
    my client wants only to be print in the first copy of 2 the report has. This I can manage to do it, but the lenght of the second copy somehow
    "contains" the rich component without printing it, so the second copy is longer as first but with blank space where the rich component is.

    I need to short the lenght of the report in the second copy when the rich its printed only in the first copy. Am I clear with all this ??

    Many thanks..


  • Leo BidiLeo Bidi Montevideo, Uruguay
    edited 3:44AM
    Hi gpi.. I've tried a lot to do what you mention but could not do it.

    I have in the child band after my footer , my rich component plus a bardoce and another box text.

    and do this code on the afterfooterprint event in my report
    procedure FooterOnAfterPrint(Sender: TfrxComponent);
    begin
      if <CopyNumber> = 1 then Engine.Showband(Child);
    end;
    

    is this correct ?? and what if i want to print only the barcode but not the rich or the box text ?

    Many thanks for your kind help.

  • Leo BidiLeo Bidi Montevideo, Uruguay
    edited 3:44AM
    This is my fr3 report just to help.

    As you can see in the final child, the 3 las components in that band are printed according the user needs and if none of them are printed
    I want the report to end in the footer and and not to print empty space..

    Am I clear enough ??

    Many thankss !!!

  • Leo BidiLeo Bidi Montevideo, Uruguay
    edited 3:44AM
    Any help please !!!

    Thank you !!!!

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.