Skip to main content
Solved

Error in Calculations of simple formular in Reports


Forum|alt.badge.img+1

I create a Report related to Project transactions; Following is a dummy implementation of that. I create two separate reports to calculate Income and Expenses, then embedded two reports in main report and calculated difference between income and expense. when i print the Income value and Expense value in the main report it printed some value. but when i calculate the difference using same variables it gives unexpected values.

Result

Report design:
 

Report design

Formular: 
= $MonthlyExpenseRp_totalExpenses - $MonthlyIncomeRp_totalIncome
i tried different formulars like,
= CInt($MonthlyExpenseRp_totalExpenses) - CInt($MonthlyIncomeRp_totalIncome)
but any of them did not works

Best answer by PDharmasena10

I was able to fix this issue. I delete this textbox (UI element) and recreate it. then it was solved. I hope it may be a onetime error.

View original
Did this topic help you find an answer to your question?

13 replies

Forum|alt.badge.img+8
  • Captain II
  • 366 replies
  • July 1, 2024

Hi @PDharmasena10 

 

Could you please share how the fields are calculated in the sub reports?

 

Aleks


lauraj46
Captain II
Forum|alt.badge.img+8
  • Captain II
  • 590 replies
  • July 1, 2024

Hi @PDharmasena10 ,

Since your numbers appear to be currency, I would use CDbl rather than CInt. 

Also, to troubleshoot this, you might try saving the values as variables in the main report and writing the formula as the difference of the two variables.  

Hope this helps!

Laura


Forum|alt.badge.img+1
  • Author
  • Varsity II
  • 57 replies
  • July 2, 2024

Hi @aiwan following is how i calculate the values in sub reports
totalIncome  =Sum([ARInvoice.CuryLineTotal]) 
totalExpenses = Sum(Abs([PMTran.Amount]))

these two values are calculated in two separate files
 

 


Forum|alt.badge.img+1
  • Author
  • Varsity II
  • 57 replies
  • July 2, 2024

Hi @lauraj46 , I tried your solution but it still same
I assign the value from sub report to a variable as bellow

Do the calculation like this :       =$totalMonthlyIncome - $totalMonthlyExpense
but it did not fixed the issue.


Forum|alt.badge.img+8
  • Captain II
  • 366 replies
  • July 2, 2024

Hi @PDharmasena10 

 

Thanks for that, looks fine, could you please share your report parameters for main report and sub report?

Could you also please share your joins?

Or share the report file please.


Forum|alt.badge.img+1
  • Author
  • Varsity II
  • 57 replies
  • July 2, 2024

@aiwan Following is main report parameters
 

Sub report Parameters
 

Main report Joins
 

 


Forum|alt.badge.img+8
  • Captain II
  • 366 replies
  • July 2, 2024

HI @PDharmasena10 

 

If i remember correctly, you should try to keep the params the same for the main and sub report.

 

This means, as long as the sub report has all the main report params, plus any extras which you deem necessary to pull the right values, this should work.

 

Currently when you run the report, the sub report does not put any values in for the parameters except for project ID.

 

Have a look at the link below, it should help clarify:

S150 Report Designer 2024 R1 (acumatica.com)


Forum|alt.badge.img+1
  • Author
  • Varsity II
  • 57 replies
  • July 2, 2024

@aiwan When embedding the sub report in the main report i have create the parameter list correctly. I think that is okay. 
 

is there any issues?

 


lauraj46
Captain II
Forum|alt.badge.img+8
  • Captain II
  • 590 replies
  • July 2, 2024

Hi @PDharmasena10 ,

To troubleshoot this you could try making some changes to the subtraction formula.  For example, try CDbl($MonthlyExpenseRp_totalExpenses) - 1.  If that gives you the correct value then check the value of the other subreport.  Maybe this will give you an idea of where the breakdown is occurring.   

Also, try specifying a format string (e.g. #.00) for the calculated control.

Laura


Forum|alt.badge.img+1
  • Author
  • Varsity II
  • 57 replies
  • July 3, 2024

@lauraj46 I tried with simple numeric formular (= 100 - 20), even that gives wired answers.  
 

 


Forum|alt.badge.img+8
  • Captain II
  • 366 replies
  • July 3, 2024

Hi @PDharmasena10 

 

Do you mind sharing the report file so we can have a look?


Forum|alt.badge.img+1
  • Author
  • Varsity II
  • 57 replies
  • July 15, 2024

@aiwan Hi herewith i have attached the report files, PM600014 is the main report. other two are sub reports.


Forum|alt.badge.img+1
  • Author
  • Varsity II
  • 57 replies
  • Answer
  • July 19, 2024

I was able to fix this issue. I delete this textbox (UI element) and recreate it. then it was solved. I hope it may be a onetime error.


Reply


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings