Complex Invoice footer

Stimulsoft Reports.NET discussion
Post Reply
Tobias
Posts: 104
Joined: Mon Nov 24, 2008 8:44 am

Complex Invoice footer

Post 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
Edward
Posts: 2913
Joined: Fri Jun 09, 2006 4:02 am

Complex Invoice footer

Post 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.
Tobias
Posts: 104
Joined: Mon Nov 24, 2008 8:44 am

Complex Invoice footer

Post 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
Tobias
Posts: 104
Joined: Mon Nov 24, 2008 8:44 am

Complex Invoice footer

Post 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.
Vital
Posts: 1278
Joined: Fri Jun 09, 2006 4:04 am

Complex Invoice footer

Post 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.
Tobias
Posts: 104
Joined: Mon Nov 24, 2008 8:44 am

Complex Invoice footer

Post by Tobias »

PrintAtBottom works but it's not very intuitive.

Thanks!
Andrew
Posts: 4109
Joined: Fri Jun 09, 2006 3:58 am

Complex Invoice footer

Post 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.
Tobias
Posts: 104
Joined: Mon Nov 24, 2008 8:44 am

Complex Invoice footer

Post 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

Edward
Posts: 2913
Joined: Fri Jun 09, 2006 4:02 am

Complex Invoice footer

Post 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.
Post Reply