How to use variable values from a subreport in calculations with data from main report?

  • 7 December 2020
  • 1 reply
  • 720 views

Haven’t had any luck finding more detailed instructions on being able use variables from a sub report in calculations back on the main report.  I know you have to be able to do this and I can do it easily in Crystal reports.  There are a few lines ive found in the help about using the subreport name in variable name to retrieve it but hasnt worked.  If anyone has some samples to show that would be great, thank you!

 

 


1 reply

Userlevel 5
Badge +2

Mike, 

What I found was that I had to convert the variable to a number using the CDec Function.
Here is an example, from a live system, were the $subReport_PayTotal is passed from the subreport

We multiply by -1 if the type is a credit memo.

=IIF ( [SOOrder.OrderType]<>'CM',( CDec([SOOrder.CuryOrderTotal]) - CDec($subReport1_PayTotal) ), (CDec([SOOrder.CuryOrderTotal]) - CDec($subReport1_PayTotal)) * -1)

 

 

Reply


About Acumatica ERP system
Acumatica Cloud ERP provides the best business management solution for transforming your company to thrive in the new digital economy. Built on a future-proof platform with open architecture for rapid integrations, scalability, and ease of use, Acumatica delivers unparalleled value to small and midmarket organizations. Connected Business. Delivered.
© 2008 — 2024  Acumatica, Inc. All rights reserved