OnBeforePrint
Hi,
I would change the value of a table field just before printing it (add a prefix).
I suppose that I must use the event OnBeforePrint. But how can I assign the new value which must be printed ?
Thank you.
Regards.
Groupir.
I would change the value of a table field just before printing it (add a prefix).
I suppose that I must use the event OnBeforePrint. But how can I assign the new value which must be printed ?
Thank you.
Regards.
Groupir.
Comments
Groupir,
We had this same requirement just today. Here is how we solved it. We placed a Text object named mCLIENT_ORDER_DETAIL_COD_PRODUCTNO on our detail band; the text object was not bound to any field, it was just sitting there with nothing in it.
Here is the code we added to the OnBeforePrint event:
In this example, we chose to add the letter X in front of our SKU only if the SKU was 7Q32221-999-M-M, otherwise we simply printed the SKU.
We chose to name the Text object this way (mCLIENT_ORDER_DETAIL_COD_PRODUCTNO) so that when we read the code we know what field we are playing with, but you could have name the field "Larry" or "Elvis" or any name you choose. The idea here is that we can use the OnBeforePrint event to dump anything we want into that field.
Hope this helps.
Regards,
Tony.