Hello
I had a quick question. I created a report for a user that allows the user to select Cust ledger entries and they could print a receipt for the selected entries. The user wants to modify the calculation of the Amount field in the report. If the user selects a Document type of “Invoice” and “Credit Memo”, she wants to see the sum of the two amount fields. Currently it shows the value of Amount field if the document type is "Invoice". Lets say the Document type is Invoice and the amount field contains a value of 100. Another line, has a document type of “Credit Memo” and the amount field contains a value of 50. So when the receipt report is printed the final amount field to show $50 (100 - 50).
When I was trying to debugging the code: I put a line of code: Message(‘Value %1’, TotalAmountC) and when i run the report, i get a message prompt which displays the correct answer. However, in the report it doesn’t display the correct answer. Any ideas or suggestions how I can get past this issue. Any help will be greatly appreciated.
TotalAmountI is sume of all the document type which are invoices. TotalAmountIC is the sum of all document type: Credit Memo
The code is written in the OnAfterGetRecord of the dataitem.
IF ("Cust. Ledger Entry"."Document Type" = "Cust. Ledger Entry"."Document Type"::"Credit Memo") THEN
BEGIN
// CurrReport.SHOWOUTPUT(FALSE);
TotalAmountIC := "Cust. Ledger Entry".Amount + TotalAmountIC;
MESSAGE('tOTAL IS %1 ', TotalAmountIC);
Total := TotalAmountI + TotalAmountIC;
END;
If I put the label in the footer section of the report, it display the correct value, but when its in the body section it doesnt work. What could I be doing wrong??
Answers
1. Which dataitem is in your report?
2. What are you printing in body section?
I think that is the reason its not working. Is there a way around this??
KCP Consultores
Thanksss!!! It took me a while to get it working but It works now.
KCP Consultores