Subscribe for automatic updates: RSS icon RSS

Login icon Sign in for full access | Help icon Help
Advanced search

Pages: [1]
  Reply  |  Print  
Author Topic: remittance advice slip  (Read 11867 times)
John T.
Posts: 14


« on: May 21, 2009, 06:57:26 am »

Hi,

I am trying to do an invoice with the report writer.  I do not see how to do the remittance advice slip at the bottom of the last page of the invoice.  I have tried using a variable to set the visibility condition of a footer but have had no luck getting the value I want in the footer.  I had Visibility Condition set to {after_invoice==1}, and sent this to the gre with the on every row statement, ie after_invoice was set to 1 on last sale item on the invoice.

Anyway, my Footer seemed to take the value at an earlier stage and had 0, ie no footer printed.

I am not even sure I am trying to do the right thing.  I may have missed it, but I did not see an example doing something like this in the demo directory.

Any help would be much appreciated.


Regards,

John
Alex G.
Four Js
Posts: 134


« Reply #1 on: May 21, 2009, 05:17:17 pm »

Hi John,
unfortunately there is no section="lastPageFooter" which would solve your problem, correct? What you can do is to create an artificial footer that does not use the "section" mechanism. You create a box that is printed after the last data item (e.g. triggered after the every row loop). As a first step make sure that the box is printed at the correct point in time (trigger). The box should appear below the last data item. In a second step you try to make sure that the box appears at the bottom of the page (if so required). In order to achieve this, you could set its size to an expression similar to y-size="max(4cm,rest)" and place the content at the bottom of this box (if required, you can overwrite the regular footer using a "white" background). The expression makes the box be at least 4cm high and it will occupy the entire blank space at the bottom of the page (excluding the footer). In case that your regular footer is the same size or larger than the advice slip, you could also set a fixed position at the bottom as follows: anchorY="1" y-position="max".
Regards,
Alex Geller
John T.
Posts: 14


« Reply #2 on: May 22, 2009, 06:03:33 am »

Hi Alex,

Thanks.  That is exactly what I wanted.  Easy when you know how!

Regards,

John
John T.
Posts: 14


« Reply #3 on: May 25, 2009, 05:08:34 am »

Hi Alex,

After saying it was easy I now have a problem.   When I have many sale items so that I nearly fill the page, my remittance advise does not print at the bottom of the page as expected.  However it is printing at the top of the next page instead of at the bottom.  I am expecting a page which is blank except for the remittance advice at the bottom.  Even worse, it now has the next invoice following on the same page.   This is not good.    I tried to follow your instructions.  Maybe my setting are still not good.

If you require more information in order to help I can try and replicate the the problem with a small test program and send all the files.

regards,

John
Reuben B.
Four Js
Posts: 845


« Reply #4 on: May 25, 2009, 05:46:17 am »

John,

If it makes you feel any better, I get the same trying out Alex's suggestion.

Alex: can you please take OrderReport.4rp from demo/samples and modify it so that ...

1. each order starts on a new page
2. at the end of the last page of each order, at the bottom, there is a 6cm tall section labelled Remittance Advice that includes the order number and the order total.

That should show the techniques that allow John to achieve what he is after.


John: To go back to your original post, I believe the value of after_invoice you would see in the footer would correspond to the value of the first line processed, not the line that is being processed on the last row of the page. i.e. in 4GL we can do

PAGE TRAILER
   PRINT orderline.lineitem.linenum

and get the last linenumber being processed.  Adding orderline.lineitem.linenum to something that has Section=*Footer is not the equivalent as it uses the first row on the page, not the last row.

Reuben

Register for WWDC 21 at https://4js.com/wwdc21online/

Product Consultant (Asia Pacific)
Developer Relations Manager (Worldwide)
Author of https://4js.com/ask-reuben
Contributor to https://github.com/FourjsGenero
Alex G.
Four Js
Posts: 134


« Reply #5 on: May 25, 2009, 10:38:43 am »

Hi John,
if the slip is printed orphaned on a separate page, then this means that there wasn't enough space on the previous page. I think a good idea would be to have a look at your sample as you proposed. Can you make a 4rp that runs with the OrderRerport demo? That would be the simplest.
Hi Reuben,
if you change x-size="max(6cm,rest) and bgColor="red" on the object StripeLayouter31 in the report OrderReport.4rp you get forces page breaks after each order and one could put the remittance advice in this (red) box.
Regards,
Alex
Reuben B.
Four Js
Posts: 845


« Reply #6 on: May 25, 2009, 11:57:36 am »

...
Hi Reuben,
if you change x-size="max(6cm,rest) and bgColor="red" on the object StripeLayouter31 in the report OrderReport.4rp you get forces page breaks after each order and one could put the remittance advice in this (red) box.
Regards,
Alex


now change LayoutNode31 (note LayoutNode31 not StripeLayout31) so that the X-Size="3cm" to simulate extra lines in the document.  You should hopefully see that when it comes time to draw StripeLayouter31 there isn't 6cm left in the page, so StripeLayouter31 is drawn on the next page at the top (not at the bottom) and the next order continues immediately after (not on a new page)

Reuben

Register for WWDC 21 at https://4js.com/wwdc21online/

Product Consultant (Asia Pacific)
Developer Relations Manager (Worldwide)
Author of https://4js.com/ask-reuben
Contributor to https://github.com/FourjsGenero
Alex G.
Four Js
Posts: 134


« Reply #7 on: May 25, 2009, 04:40:31 pm »

Yes sorry, you a right. This happens in the case that the space left is smaller than 6cm. Please try the following: Add a layoutnode as "last child" of trigger "Group orderid". In other words, make it the "next sibling" of "MiniPage2". Configure the node as follows: <LAYOUNODE x-size="max" y-size="rest<6cm?max:rest" bgColor="#ff00ff"/>
This workes fine for varying height of "LayoutNode31". The idea is, that the box will occupy an entire page in case that the space left is smaller than 6cm. In all other cases the box occupies what ever space is left.
John T.
Posts: 14


« Reply #8 on: May 26, 2009, 02:00:52 am »

Hi Alex,

Setting y-size=rest<8cm?max:rest worked for the output.  However it did reduce the size of my layout node in the designer window to nothing for the y axis.  Therefore when my minipage was attached to the bottom of this node the elements of the minipage went up over my other design elements.
I changed it to max(8cm,rest<8cm?max:rest) and it came right in the designer window.

Thanks for you help.

Regards,

John

Pages: [1]
  Reply  |  Print  
 
Jump to:  

Powered by SMF 1.1.21 | SMF © 2015, Simple Machines