FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour GroupFooter - FastReport
Posts: 6984
Joined: Fri Oct 07, 2005 07:07 PM

GroupFooter - FastReport

Posted: Sun Feb 28, 2010 10:24 PM

Hello Randal,
My email was blocked. Do you have another email.
Best regards,
Otto

Posts: 284
Joined: Mon Oct 24, 2005 08:04 PM

Re: OT: for Rendal

Posted: Mon Mar 01, 2010 04:20 AM

Otto,

Thanks for your reply. Try me at scebee@yahoo.com.

If you think the question about FastReport might be beneficial to someone else here please feel free to respond here.

Thanks,
Randal

Posts: 6984
Joined: Fri Oct 07, 2005 07:07 PM

Re: OT: for Rendal

Posted: Mon Mar 01, 2010 07:11 AM

Hallo Randal,
I think you can do it with the ONBeforePrint Event:
PascalScript
procedure F_GroupFooter1(Sender: TfrxComponent);
begin
GroupFooter1.Visible := <TestLogischeVariable> ; // not empty or whatever you want or pass a variable like I do it here
end;

What I also do is to use a memofield and set the StretchMode to SMMaxHeight.

Best regards,
Otto

Posts: 6984
Joined: Fri Oct 07, 2005 07:07 PM

Re: OT: for Rendal

Posted: Mon Mar 01, 2010 07:21 AM

Hello Randal,
please look at this thread:

viewtopic.php?f=3t=18227p=95574#p95574
Best regards,
Otto

&&

Posts: 284
Joined: Mon Oct 24, 2005 08:04 PM

Re: OT: for Rendal

Posted: Tue Mar 02, 2010 03:08 PM
Otto,

I don't understand how this will address my problem.

I have a number of totals in the group footer but some of the total lines are conditional. When some of the total lines are not applicable I need for the other total lines to move up. For example:

Subtotal xx.xx
Sales Tax xx.xx
Previous Balance xx.xx
Total xx.xx

If there is no sales tax then it should print:

Subtotal xx.xx
Previous Balance xx.xx
Total xx.xx

In this case the number of lines the group footer band prints will be one less.

Thanks,
Randal





Otto wrote:Hallo Rendal,
I think you can do it with the ONBeforePrint Event:
PascalScript
procedure F_GroupFooter1(Sender: TfrxComponent);
begin
GroupFooter1.Visible := <TestLogischeVariable> ; // not empty or whatever you want or pass a variable like I do it here
end;

What I also do is to use a memofield and set the StretchMode to SMMaxHeight.

Best regards,
Otto
Posts: 6984
Joined: Fri Oct 07, 2005 07:07 PM

Re: OT: for Rendal

Posted: Tue Mar 02, 2010 05:17 PM
Hello Randal,
There are many ways to do. Every control has events.
For example you could do:

Inset a text lable you call Memo42 and one Memo43 or change the code.
The text on Memo42 should be "noSales Tax" then run the report. You see the text is printed at Top = 250
If you change the text Memo43 is printed at:
Memo43.TOP := 164;
Memo43.LEFT := 64;


Code (fw): Select all Collapse
procedure Memo43OnBeforePrint(Sender: TfrxComponent);
begin  

 if   TRIM( Memo42.TEXT ) =  'noSales Tax' then            // here is your condition        
  begin    
  showmessage ( Memo42.TEXT );
  Memo43.TOP := 250;  
 end

else

begin
   showmessage ( Memo42.TEXT );
   Memo43.TOP := 164;
    Memo43.LEFT := 64;      
end;

  
end;
  
begin

end.


This is only to demonstrate. I think it would be better to have own bands which you show if the condition is true.
Best regards,
Otto







Posts: 284
Joined: Mon Oct 24, 2005 08:04 PM

Re: OT: for Rendal

Posted: Tue Mar 02, 2010 06:49 PM

Otto,

How would you do it with different bands?

Randal

Posts: 6984
Joined: Fri Oct 07, 2005 07:07 PM

Re: OT: for Rendal

Posted: Tue Mar 02, 2010 07:56 PM

Randal,
could you send me your report file.
Best regards,
Otto

Posts: 284
Joined: Mon Oct 24, 2005 08:04 PM

Re: OT: for Rendal

Posted: Tue Mar 02, 2010 09:51 PM

Otto,

I took your advice and set it up using a seperate group footer for each of the conditional total lines. This seems to work fine.

On another note, I copy/pasted your sample code and I keep getting an error when trying to print until I add another BEGIN END statement.

procedure F_GroupFooter1(Sender: TfrxComponent);
begin
GroupFooter1.Visible := <Invoice."tax"> > 0;
end;

with the above I get a message: 'BEGIN' expected

In the following I add BEGIN END and it works fine.

procedure F_GroupFooter1(Sender: TfrxComponent);
begin
GroupFooter1.Visible := <Invoice."tax"> > 0;
end;

BEGIN
END.

Perhaps we should change the title of this thread?

Thanks,
Randal

Posts: 6984
Joined: Fri Oct 07, 2005 07:07 PM

Re: GroupFooter - FastReport

Posted: Tue Mar 02, 2010 10:33 PM

Hello Randal,

I changed the title to GroupFooter – FastReport.- Please excuse me that I spelled your name the wrong way.

> I took your advice and set it up using a seperate group footer for each of the conditional total lines.
If you use more “group footer” do you have to insert for every “group footer” a “group header”?

I thought you could also try to insert pages and set on these the PrintOnPreviousePage to TRUE.
Best regards,
Otto

Continue the discussion