GroupFooter - FastReport

GroupFooter - FastReport

Postby Otto » Sun Feb 28, 2010 10:24 pm

Hello Randal,
My email was blocked. Do you have another email.
Best regards,
Otto
Last edited by Otto on Tue Mar 02, 2010 10:36 pm, edited 2 times in total.
********************************************************************
mod harbour - Vamos a la conquista de la Web
modharbour.org
https://www.facebook.com/groups/modharbour.club
********************************************************************
User avatar
Otto
 
Posts: 6073
Joined: Fri Oct 07, 2005 7:07 pm

Re: OT: for Rendal

Postby Randal » Mon Mar 01, 2010 4: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
Randal
 
Posts: 260
Joined: Mon Oct 24, 2005 8:04 pm

Re: OT: for Rendal

Postby Otto » Mon Mar 01, 2010 7: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
Last edited by Otto on Tue Mar 02, 2010 10:34 pm, edited 1 time in total.
********************************************************************
mod harbour - Vamos a la conquista de la Web
modharbour.org
https://www.facebook.com/groups/modharbour.club
********************************************************************
User avatar
Otto
 
Posts: 6073
Joined: Fri Oct 07, 2005 7:07 pm

Re: OT: for Rendal

Postby Otto » Mon Mar 01, 2010 7:21 am

Hello Randal,
please look at this thread:

viewtopic.php?f=3&t=18227&p=95574#p95574
Best regards,
Otto
********************************************************************
mod harbour - Vamos a la conquista de la Web
modharbour.org
https://www.facebook.com/groups/modharbour.club
********************************************************************
User avatar
Otto
 
Posts: 6073
Joined: Fri Oct 07, 2005 7:07 pm

Re: OT: for Rendal

Postby Randal » Tue Mar 02, 2010 3: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
Randal
 
Posts: 260
Joined: Mon Oct 24, 2005 8:04 pm

Re: OT: for Rendal

Postby Otto » Tue Mar 02, 2010 5: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: Select all  Expand view

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

Image

Image

Image

Image
Last edited by Otto on Tue Mar 02, 2010 10:34 pm, edited 1 time in total.
********************************************************************
mod harbour - Vamos a la conquista de la Web
modharbour.org
https://www.facebook.com/groups/modharbour.club
********************************************************************
User avatar
Otto
 
Posts: 6073
Joined: Fri Oct 07, 2005 7:07 pm

Re: OT: for Rendal

Postby Randal » Tue Mar 02, 2010 6:49 pm

Otto,

How would you do it with different bands?

Randal
Randal
 
Posts: 260
Joined: Mon Oct 24, 2005 8:04 pm

Re: OT: for Rendal

Postby Otto » Tue Mar 02, 2010 7:56 pm

Randal,
could you send me your report file.
Best regards,
Otto
Last edited by Otto on Tue Mar 02, 2010 10:34 pm, edited 1 time in total.
********************************************************************
mod harbour - Vamos a la conquista de la Web
modharbour.org
https://www.facebook.com/groups/modharbour.club
********************************************************************
User avatar
Otto
 
Posts: 6073
Joined: Fri Oct 07, 2005 7:07 pm

Re: OT: for Rendal

Postby Randal » Tue Mar 02, 2010 9: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
Randal
 
Posts: 260
Joined: Mon Oct 24, 2005 8:04 pm

Re: GroupFooter - FastReport

Postby Otto » 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
********************************************************************
mod harbour - Vamos a la conquista de la Web
modharbour.org
https://www.facebook.com/groups/modharbour.club
********************************************************************
User avatar
Otto
 
Posts: 6073
Joined: Fri Oct 07, 2005 7:07 pm


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: Google [Bot] and 32 guests