So I'm trying to display my variable value in my report. But it prints in the message "Numerario" but in the report is not showing anything..
OnPreDataItem()
PaymentMethodCode:=CustLedgEntry2."Payment Method Code";
PaymentMethod.GET(PaymentMethodCode);
PaymentMethodDescription:=PaymentMethod.Description;
MESSAGE('%1',PaymentMethodDescription);
https://us.v-cdn.net/5022383/uploads/editor/ew/3y66qx8ovy4u.png
My var PaymentMethodDescription have the option "Include in dataset to true"
---
ALL CODE UPDATED:
Documentation()
OnInitReport()
ShowLogo := TRUE; // LACT - jorge.rocha -> TRUE: show company logo
OnPreReport()
OnPostReport()
Cust. Ledger Entry - OnPreDataItem()
CompanyInfo.GET;
FormatAddr.Company(CompanyAddr,CompanyInfo);
GLSetup.GET;
ReportFooterCompany := STRSUBSTNO(ReportFooterCompanyLbl,CompanyInfo."Social Capital", CompanyInfo."VAT Registration No.", CompanyInfo."Registration Authority", CompanyInfo."Comercial Registration No.");
Cust. Ledger Entry - OnAfterGetRecord()
Cust.GET("Customer No.");
FormatAddr.Customer(CustAddr,Cust);
IF (CustLedgEntry2."Payment Method Code"='') THEN
PaymentMethod.INIT
ELSE BEGIN
PaymentMethodCode:=CustLedgEntry2."Payment Method Code";
PaymentMethod.GET(PaymentMethodCode);
PaymentMethodDescription:=PaymentMethod.Description;
END;
IF NOT Currency.GET("Currency Code") THEN
Currency.InitRoundingPrecision;
IF "Document Type" = "Document Type"::Payment THEN BEGIN
ReportTitle := Text003;
PaymentDiscountTitle := Text006;
END ELSE BEGIN
ReportTitle := Text004;
PaymentDiscountTitle := Text007;
END;
CALCFIELDS("Original Amount");
RemainingAmount := -"Original Amount";
Signature := ReportCertificate + CompanyInfo."Soft. Certificate Number" + ReportCode;
Cust. Ledger Entry - OnPostDataItem()
PageLoop - OnPreDataItem()
PageLoop - OnAfterGetRecord()
PageLoop - OnPostDataItem()
DetailedCustLedgEntry1 - OnPreDataItem()
DetailedCustLedgEntry1 - OnAfterGetRecord()
DetailedCustLedgEntry1 - OnPostDataItem()
CustLedgEntry1 - OnPreDataItem()
CustLedgEntry1 - OnAfterGetRecord()
IF "Entry No." = "Cust. Ledger Entry"."Entry No." THEN
CurrReport.SKIP;
PmtDiscInvCurr := 0;
PmtTolInvCurr := 0;
PmtDiscPmtCurr := 0;
PmtTolPmtCurr := 0;
ShowAmount := -DetailedCustLedgEntry1.Amount;
IF "Cust. Ledger Entry"."Currency Code" <> "Currency Code" THEN BEGIN
PmtDiscInvCurr := ROUND("Pmt. Disc. Given (LCY)" * "Original Currency Factor");
PmtTolInvCurr := ROUND("Pmt. Tolerance (LCY)" * "Original Currency Factor");
AppliedAmount :=
ROUND(
-DetailedCustLedgEntry1.Amount / "Original Currency Factor" *
"Cust. Ledger Entry"."Original Currency Factor",Currency."Amount Rounding Precision");
END ELSE BEGIN
PmtDiscInvCurr := ROUND("Pmt. Disc. Given (LCY)" * "Cust. Ledger Entry"."Original Currency Factor");
PmtTolInvCurr := ROUND("Pmt. Tolerance (LCY)" * "Cust. Ledger Entry"."Original Currency Factor");
AppliedAmount := -DetailedCustLedgEntry1.Amount;
END;
PmtDiscPmtCurr := ROUND("Pmt. Disc. Given (LCY)" * "Cust. Ledger Entry"."Original Currency Factor");
PmtTolPmtCurr := ROUND("Pmt. Tolerance (LCY)" * "Cust. Ledger Entry"."Original Currency Factor");
RemainingAmount := (RemainingAmount - AppliedAmount) + PmtDiscPmtCurr + PmtTolPmtCurr;
CustLedgEntry1 - OnPostDataItem()
DetailedCustLedgEntry2 - OnPreDataItem()
DetailedCustLedgEntry2 - OnAfterGetRecord()
DetailedCustLedgEntry2 - OnPostDataItem()
CustLedgEntry2 - OnPreDataItem()
CustLedgEntry2 - OnAfterGetRecord()
IF "Entry No." = "Cust. Ledger Entry"."Entry No." THEN
CurrReport.SKIP;
PmtDiscInvCurr := 0;
PmtTolInvCurr := 0;
PmtDiscPmtCurr := 0;
PmtTolPmtCurr := 0;
ShowAmount := DetailedCustLedgEntry2.Amount;
IF "Cust. Ledger Entry"."Currency Code" <> "Currency Code" THEN BEGIN
PmtDiscInvCurr := ROUND("Pmt. Disc. Given (LCY)" * "Original Currency Factor");
PmtTolInvCurr := ROUND("Pmt. Tolerance (LCY)" * "Original Currency Factor");
END ELSE BEGIN
PmtDiscInvCurr := ROUND("Pmt. Disc. Given (LCY)" * "Cust. Ledger Entry"."Original Currency Factor");
PmtTolInvCurr := ROUND("Pmt. Tolerance (LCY)" * "Cust. Ledger Entry"."Original Currency Factor");
END;
PmtDiscPmtCurr := ROUND("Pmt. Disc. Given (LCY)" * "Cust. Ledger Entry"."Original Currency Factor");
PmtTolPmtCurr := ROUND("Pmt. Tolerance (LCY)" * "Cust. Ledger Entry"."Original Currency Factor");
AppliedAmount := DetailedCustLedgEntry2.Amount;
//RemainingAmount := (RemainingAmount - AppliedAmount) + PmtDiscPmtCurr + PmtTolPmtCurr; // LACT commented
CustLedgEntry2 - OnPostDataItem()
Total - OnPreDataItem()
Total - OnAfterGetRecord()
Total - OnPostDataItem()
Gen. Journal Line - OnPreDataItem()
Gen. Journal Line - OnAfterGetRecord()
Gen. Journal Line - OnPostDataItem()
LOCAL CurrencyCode(SrcCurrCode : Code[10]) : Code[10]
IF SrcCurrCode = '' THEN
EXIT(GLSetup."LCY Code");
EXIT(SrcCurrCode);
Answers
Move the code to OnAfterGetRecord trigger.
And pay attention at each iteration, it is overwritten.
Also you can moove this code to CustLedgEntry2 DataItem without changes.
You just try to call wrong DataItem.
Also you can use ReportItems! (for footer/header).
Is not showing anything...
you try to get value from LAST line from all DataSet lines. That is, it will always be static and possibly even empty.
For correct work create textbox inside table group, write check textbox name, example textbox42
then create textbox on header, and write
Also, you need put first textbox in right place.
Thanks again!!!!