AugForums.com

An Acumatica User Group

  • Free
    • Start Here
    • Rolodex
    • Podcast
    • Blog
    • Forums
  • Paid
    • AugSQL
    • GI Course
    • GI Library
    • Consulting
  • Register
Acumatica Forums

By using this website, you agree to our Terms of Use (click here)

Forums
AUG Forums
Acumatica Report De...
Need help with erro...
 
Notifications
Clear all

Questions Need help with error please.... Cannot perform '=' operation on System.Int32 and System.String

 
Acumatica Report Designer
Last Post by Tim Rodman 8 years ago
4 Posts
2 Users
2 Reactions
4,293 Views
RSS
Posts: 4
 Emma
Topic starter
March 16, 2018 6:22 pm
(@emma-m)
Member
Joined: 8 years ago

Hi all, i'm running into an issue with an iif calc on my report.. please see error and code below...

I have tried all of the following and can't figure it out:ย 

=IIf([JPMBillingRule.JPMBillTypeID] = 'Fixed Price', $Var1, $Var2)

=IIf([JPMBillingRule.JPMBillTypeID] = 'Fixed Price', CStr($Var1), CStr($Var2))

part of the long error message i receive says:ย 

PX.Reports.Parser.ExpressionException: Cant calculate expression node: 'groupHeaderSection1 (PX.Reports.Data.GroupSectionNode) dataItem: System.Object[]'. ---> 
PX.Reports.Parser.ExpressionException: Cant calculate expression part: 'IIf(UnaryOp:ย ย (BinaryOp = (Identifier(JPMBillingRule.JPMBillTypeID), Const(Fixed Price))),
PX.Reports.Parser.FunctionNode, PX.Reports.Parser.FunctionNode)'. --->
PX.Reports.Parser.ExpressionException: Cannot perform '=' operation on System.Int32 and System.String.ย 

does anyone see any glaring errors or have some troubleshooting tips??ย  ย many thanks!!


3 Replies
Tim Rodman
Posts: 3195
 Tim Rodman
Admin
March 16, 2018 11:37 pm
(@timrodman)
Famed Member
Joined: 10 years ago

Hi Emma,

I think the issue here is that JPMBillingRule.JPMBillTypeID is actually a integer (System.Int32) whereas Fixed Price is a string (System.String).

This is a good example of why it's good to be aware that you are actually building reports on Data Access Classes, not database tables directly. This was my first experience realizing this:
https://www.augforums.com/lesson-learned-dont-abandon-the-acumatica-data-access-classes-dac/

JPMBillingRule.JPMBillTypeID might get displayed on the screen as Fixed Price, but it's likely stored in the database as an integer. So when you try to do a calculation like a comparison, you get an error.


Reply
Mike A reacted
Posts: 4
 Emma
Topic starter
March 17, 2018 8:29 pm
(@emma-m)
Member
Joined: 8 years ago

Awesome!!ย  Thank you so much; I checked out the post that you linked and looked up correct DAC and added it to the schema and the correct field onto the report!! That definitely worked!!! Appreciate it ๐Ÿ™‚ย 


Reply
Tim Rodman
Posts: 3195
 Tim Rodman
Admin
March 19, 2018 9:57 pm
(@timrodman)
Famed Member
Joined: 10 years ago

Sweet! Glad it worked out.

Also, just in case you don't already know about Inspect Element, check this out:

https://www.augforums.com/inspect-element-best-friend/


Reply
Mike A reacted
Forum Jump:
  Previous Topic
Next Topic  
Forum Information
Recent Posts
Unread Posts
Tags
  • 12 Forums
  • 2,526 Topics
  • 10.9 K Posts
  • 42 Online
  • 2,411 Members
Our newest member: thollings
Latest Post: Generic inquiry with information from Audit history(CT301000)
Forum Icons: Forum contains no unread posts Forum contains unread posts
Topic Icons: Not Replied Replied Active Hot Sticky Unapproved Solved Private Closed

Online Members

 No online members at the moment

Acumatica Forums

Terms of Use & Disclaimers :: Privacy Policy

Copyright ยฉ 2025 ยท AUG Forums, LLC. All rights reserved. This website is not owned, affiliated with, or endorsed by Acumatica, Inc.

โ€นโ€บร—

    โ€นโ€บร—