AUGForums.com

An Acumatica User Group

  • Free
    • Start Here
    • Rolodex
    • Podcast
    • Blog
    • Forums
  • Course
  • Consulting
  • Login
  • Register
Acumatica Forums

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

  • Overview
  • Member List
  • All-Stars
  • Stats
  • Recent Posts
  • Help
Forums
AUG Forums
Acumatica Report De...
Global Variables - ...
 
Notifications
Clear all

In order to allow me to focus on Consulting (click here) and Courses (click here), I continue to review all posts here in the Forums, but, in general, I'm only personally responding to posts that I mark as #AcumaticaTnT (click here). For Questions (click here), others may respond, or you can post over at Community.Acumatica.com (click here).
Sincerely,
Tim Rodman

Questions Global Variables - Setting Variable Type - $Variable - Report Variable Collection Editor

Acumatica Report Designer
Last Post by mcraig 7 months ago
3 Posts
2 Users
1 Likes
243 Views
RSS
mcraig
Posts: 48
 mcraig
Topic starter
July 5, 2022 6:10 pm
(@mcraig)
Member
Joined: 3 years ago

I have been using and creating global variables in sub reports, and it seems they are of type numeric by default. 

In reading wiki, i have included the text

You specify a local variable for the report section. This variable is visible in all other sections of the report. If you declare the same variable in multiple sections, the variable is shared between them. If the variable is modified in one section, the new value of the variable is passed to the next section where the variable is used. The variable is initiated in the topmost section where it is used. Then the variable is sequentially modified in the following sections in the order in which these sections are printed in the report.

To define a variable, you use the Behavior > Variables property of the report section.

The variables have the VariableName}} format, where VariableName is the name of the variable defined in the report.

The following example illustrates the use of the RowNumber}} local variable in the expression.

 
 
=Assign( '$RowNumber', $RowNumber + 1 )

In a report, you can use a variable defined in a subreport. In this case, the variable has the ReportName_VariableName}} format, where ReportName is the name of the report in which the variable is defined. For example, suppose that you have defined the pmt}} variable in the payment report. If you need to use this variable in another report in your Acumatica ERP instance, you refer to this variable as $payment_pmt.

 

Question 1: I have been defining the same variable in each section. This doesn't seem to be required.

Question

2: Is there a definition format in that you can set a global variable to String, Boolean, date time , float, integer?

global variables
global varables section 1

If there is no data, instead of checking <> Null I have to check for <> '0'  

 

Looking for a more information .

 

thanks

Matt

 

2 Replies
Tim Rodman
Posts: 2957
 Tim Rodman
Admin
July 6, 2022 11:28 am
(@timrodman)
Member
Joined: 7 years ago

1. Once you define a variable in a section, it's available in that section and the sections below that section.

2. Good question. I try to avoid variables and don't use them that much so I haven't taken notice of a "type" for variables. If you use CStr() to convert the value to a string, is it still a numeric variable? @michaelhansen loves variables and he might have more insight on this.

Reply
mcraig
 mcraig
(@mcraig)
Joined: 3 years ago

Member
Posts: 48
July 6, 2022 12:02 pm
Reply toTim RodmanTim Rodman

@timrodman  Using a global variable inside a sub-report to return a value can simplify a problem.  Sometimes the number of joins to get some information can cause problems in the report.   Using a sub-report all that stuff is not part of the original report. 

When I read the wiki it seemed like you can define its type.  I spent some time trying without success.   I was wondering if maybe they prefix a variable in some way or add a type. Some undocumented features.

 

Reply
Tim Rodman reacted
Forum Jump:
  Previous Topic
Next Topic  
Forum Information
Recent Posts
Unread Posts
Tags
  • 11 Forums
  • 2,236 Topics
  • 9,868 Posts
  • 7 Online
  • 1,812 Members
Our newest member: Heather Jones
Latest Post: Sales Order Comment Lines / Memo / Note Lines
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

Acumatica Forums

Terms of Use & Disclaimers :: Privacy Policy

Copyright © 2023 · AUG Forums, LLC. All rights reserved. This website is not owned, affiliated with, or endorsed by Acumatica, Inc.

‹›×

    ‹›×