Page 1 of 1

Complex Invoice footer

Posted: Tue Dec 23, 2008 8:51 am
by Tobias
A customer needs the following invoice footer below the databand with the list of invoice items:

Image

The Tax, Net and Gross values are SumIf() expressions which calculate the respective totals from the list of invoice items.

My question here is: If e.g. Tax 2 in the above example isn't used in the invoice, how can I make the footer skip this line and automatically shrink?

thx,

Tobias

Complex Invoice footer

Posted: Wed Dec 24, 2008 9:18 am
by Edward
Hi Tobias,

Actually there are two ways to be recommended:

1) You may place 3 Child bands right after the Footer band and to hide Tax2 when it is necessary, in the Before Print of the appropriate ChildBand

2) There is a ShiftMode property in StiText component. Once it is set in DecreasingSize, the StiText will change its position if StiText above changes its size for example to the 0 value.

Thank you.

Complex Invoice footer

Posted: Mon Dec 29, 2008 5:56 am
by Tobias
Edward wrote: 1) You may place 3 Child bands right after the Footer band and to hide Tax2 when it is necessary, in the Before Print of the appropriate ChildBand
Adding a child band doesn't work as expected at all. My layout basically is:

PageHeader
ColumnHeader
Header
Data
EmptyBand
Footer

The EmptyBand just draws vertical lines, so that the data table fills the whole page.
If I now add a ChildBand after the Footer, the EmptyBand suddenly gets printer AFTER the Footer.

Edward wrote: 2) There is a ShiftMode property in StiText component. Once it is set in DecreasingSize, the StiText will change its position if StiText above changes its size for example to the 0 value.
This doesn't work either. If I put two Text fields on top of each other into the footer, set their ShiftMode to DecreasingSize and change the height of the top text field to 0, then this leaves just an empty space.

I've also tried to set CanShrink=true of the text fields, which basically works. If there's no text in the field, it disappears. But when I use an expression like "{Sum(Sale_Items.Amount)}", then it always shrinks to a height of 0.
Tobias

Complex Invoice footer

Posted: Mon Dec 29, 2008 6:18 am
by Tobias
I think the best way to do this is the ChildBand approach. Each tax line in the footer becomes one ChildBand and then I can simply add a condition for "Component Enabled = False" when the sum for this tax is 0.

But the EmptyBand seems to be seriously broken. As soon as I add a child band or another data band after the footer, the empty band, which should be printed before the footer, is printed after tha band I added after the footer.

Complex Invoice footer

Posted: Tue Dec 30, 2008 3:34 pm
by Vital
Hello Tobias,
Adding a child band doesn't work as expected at all. My layout basically is:
Please use PrintAtBottom property for both bands.

But when I use an expression like "{Sum(Sale_Items.Amount)}", then it always shrinks to a height of 0.
Try use following expression:

{Totals.Sum(Sale_Items, Sale_Items.Amount)}

Thank you.

Complex Invoice footer

Posted: Wed Dec 31, 2008 6:53 am
by Tobias
PrintAtBottom works but it's not very intuitive.

Thanks!

Complex Invoice footer

Posted: Fri Jan 02, 2009 2:14 pm
by Andrew
Why? EmptyBand fills free space on a page after all bands on a page are rendered. Free space starts from the bottom border of the last rendered band from the top and to the top border of the first band rendered on the bottom.

Thank you.

Complex Invoice footer

Posted: Wed Jan 07, 2009 12:53 pm
by Tobias
It's not intuitive, because when I have just a footer (without PrintAtBottom), then the footer is automatically printed at the bottom of the page and the empty space between data band and footer band is filled with the empty band. When I now add a child after the footer and the empty band now suddenly gets printed after this child band instead of before the footer, then this is nothing I would have been intuitively expecting.

It would be intuitive, if the empty band would just fill the space where it had been placed. Something like an WPF Grid layout row with Height="*".

But that's of course a matter of opinion :-)

Tobias


Complex Invoice footer

Posted: Thu Jan 08, 2009 3:24 am
by Edward
Hi Tobias,

The EmptyBand has one specific detail in its behavior. Each band with PrintAtBottom set in true will be printed below the EmptyBand. We think that this behavior of the Empty band is correct although sometimes it is really not intuitive, correct.

Maybe you have some ideas about some additional properties for the EmptyBand?

Please share them with us in that case.

Thank you.