Variable value passed to report is not being printed

catiamatos1991catiamatos1991 Member Posts: 158
edited 2018-05-30 in NAV Three Tier
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..

OnPostReport()
PaymentMethodCode:=CustLedgEntry1."Payment Method Code";
PaymentMethod.GET(PaymentMethodCode);
PaymentMethodDescription:=PaymentMethod.Description;
MESSAGE('%1',PaymentMethodDescription);

vrv6dbgis3z8.png


My var PaymentMethodDescription have the option "Include in dataset to true"

Answers

  • Wisa123Wisa123 Member Posts: 308
    edited 2018-05-25
    Hey there,

    1.) Please check if the value you want to display is actually in your dataset, because it probably isn't (-> check via ctrl+alt+f1)
    2.) OnPostReport is too late to populate your variable. This is most likely the error you made. The message works because it is executed at the very end. Construction of the Dataset passed to your layout happens before then.
    3.) For anything regarding RDLC - or other 3-Tier stuff please post in the correct forum the next time.

    regards, wisa
    Austrian NAV/BC Dev
  • catiamatos1991catiamatos1991 Member Posts: 158
    But in the AfterGetRecord() the message is empty. Is there a way to fill the variable in other place and then print the report?
  • Wisa123Wisa123 Member Posts: 308
    you can do it pretty much wherever you want, but not in OnPostReport as long as the place where you fill your variable matches its place in the dataset.
    Austrian NAV/BC Dev
  • catiamatos1991catiamatos1991 Member Posts: 158
    I think I defined the global variable PaymentMethodDescription and then assign the value in the code, to show in the report in the right way or am I missing anything?
  • krikikriki Member, Moderator Posts: 9,112
    [Topic closed because of double posting]
    See https://forum.mibuso.com/discussion/71562

    Regards,Alain Krikilion
    No PM,please use the forum. || May the <SOLVED>-attribute be in your title!


  • krikikriki Member, Moderator Posts: 9,112
    [Topic moved from 'NAV/Navision Classic Client' forum to 'NAV Three Tier' forum]

    Regards,Alain Krikilion
    No PM,please use the forum. || May the <SOLVED>-attribute be in your title!


This discussion has been closed.