AugForums.com

An Acumatica User Group

  • Free
    • Start Here
    • In-Person Gatherings
    • Power BI Workshop
    • Podcast
    • Rolodex
    • 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...
Passing Variables f...
 
Notifications
Clear all

Questions Passing Variables from Sub Report not resetting value when no Value in subreport

 
Page 1 / 2 Next
Acumatica Report Designer
Last Post by LoganG 6 years ago
23 Posts
7 Users
4 Reactions
14.9 K Views
RSS
JLange
Posts: 45
 JLange
Topic starter
December 6, 2017 11:40 pm
(@jlange)
Trusted Member
Joined: 6 years ago

I have a shared variable(e.g., $order total) which passes from a subreport group subtotal linked to the corresponding field (order number) in the main report. Some of the orders in the main report do not have a corresponding value in the subreport. If an order doesn't exist in the subreport, the previous existing $order total from the sub report incorrectly gets used in that order's calcs until the next subreport order number comes up. I've tried to vary the location of the passed variable in the main report. What is the syntax to reset the variable to zero after each order number but still grab the calc from the next order in the subreport? 


Jwright reacted
22 Replies
Tim Rodman
Posts: 3204
 Tim Rodman
Admin
December 7, 2017 12:54 am
(@timrodman)
Famed Member
Joined: 10 years ago

Hmmm, I've seen this before, but am trying to remember the specifics of it.

Would you be able to attach the main report and the subreport so I can take a look at them?


Reply
JLange
 JLange
(@jlange)
Joined: 6 years ago

Trusted Member
Posts: 45
December 7, 2017 1:44 am
Reply toTim RodmanTim Rodman

I was being lazy with the initial post as this was a Crystal report board question but the principle is the same with the attached reports.  I am pulling information from a subreport and where there is no data in the subreport it doesn't reset the value, it just holds the last actual value (see screenshot). 

 

Thanks

https://timrodman.s3.us-east-2.amazonaws.com/forums/64-ap654501.rpx

https://timrodman.s3.us-east-2.amazonaws.com/forums/63-gl61ax10.rpx


Reply
MichaelHansen
Posts: 149
 MichaelHansen
December 7, 2017 1:55 pm
(@michaelhansen)
Estimable Member
Joined: 6 years ago

I think you need to edit the variable and give it a "resetgroup" property. That tells the variable to reset itself after a specific event. It fixes issues on my end, as I have to call a subreport to do a time-phased inventory run and I needed to reset my weekly quantities. Here's a shot of what that screen looks like, please note that my group is named InventoryItem, it's not a class name, just a group name:

 

In your case, the drop down lists "Account" and I think it'll fix your issues:


Reply
JLange
 JLange
(@jlange)
Joined: 6 years ago

Trusted Member
Posts: 45
December 7, 2017 5:39 pm
Reply toMichaelHansenMichaelHansen

Initially I had the reset group set on the subreport and the value would always be zero.  It's like the timing of the reset cleared the value before it passed to the main report.  I tried putting the value in different positions in the Group header and footer but the behaviour didn't change.  Thanks for the comments though 🙂


Reply
MichaelHansen
Posts: 149
 MichaelHansen
December 7, 2017 5:43 pm
(@michaelhansen)
Estimable Member
Joined: 6 years ago

My process order is set to "always" on my variable, yours is set to "while read". Might be worth trying a quick toggle on that one, just to see if it sticks. Otherwise, I'll defer to Tim on this one as he has much more experience.


Reply
JLange
 JLange
(@jlange)
Joined: 6 years ago

Trusted Member
Posts: 45
December 7, 2017 5:49 pm
Reply toMichaelHansenMichaelHansen

Thanks Michael, pretty sure I have tried all combos but maybe I forgot this one :).


Reply
JLange
Posts: 45
 JLange
Topic starter
December 8, 2017 12:20 am
(@jlange)
Trusted Member
Joined: 6 years ago

Got it!

If you use the Function>Program Shortcuts>

Assign('$subReport1_Variable',0) at the group start it works


Reply
Tim Rodman
Posts: 3204
 Tim Rodman
Admin
December 8, 2017 1:22 am
(@timrodman)
Famed Member
Joined: 10 years ago

Thanks so much for chiming in on this Michael. I'm not sure I have much more experience on these variables because I try to avoid them as much as possible. So I totally appreciate your input.

Julian, just to clarify. Were you able to get it working by including that Assign formula in a variable at the start of the group in the main report? Like maybe replacing what you had in your Reset variable like this:

 

I wonder if something along the lines of Michael's suggestion would have worked. Something like this in the variables at the start of the group in the main report:


Reply
AhmedBahar
 AhmedBahar
(@ahmedbahar)
Joined: 6 years ago

Eminent Member
Posts: 29
July 12, 2018 1:05 pm
Reply toTim RodmanTim Rodman

Hi guys, I'm posting my question here since it seems like you guys are well beyond using subreport variables in the main report... which seems simple enough but when I try to reference the subreport1_variablename on the main report it doesn't work.

Is there something I'm missing?


Reply
JLange
Posts: 45
 JLange
Topic starter
December 8, 2017 1:26 am
(@jlange)
Trusted Member
Joined: 6 years ago

Yes Tim, the Assign was applied in a variable in the Group Header in the Main Report.

When I have a chance I'll try the other suggestion as well and feed back


Reply
Tim Rodman
Posts: 3204
 Tim Rodman
Admin
December 8, 2017 10:51 am
(@timrodman)
Famed Member
Joined: 10 years ago

Cool. Hey, as long as it's working, that's good enough for me. I was just curious 🙂


Reply
MichaelHansen
Posts: 149
 MichaelHansen
December 8, 2017 11:57 am
(@michaelhansen)
Estimable Member
Joined: 6 years ago

Well I've never used the assign function before. That's an awfully slick way to override a variable. I'll be keeping that one in my toolbox. Thanks for sharing Julian!


Reply
Tim Rodman reacted
Tim Rodman
Posts: 3204
 Tim Rodman
Admin
July 23, 2018 4:53 pm
(@timrodman)
Famed Member
Joined: 10 years ago

Hi Ahmed,

Have you tried placing the variable below the Subreport in the Main report to see if that makes a difference? Can you attach the .rpx file for both reports (the Main report and the Subreport)?


Reply
Iskandar
Posts: 24
 Iskandar
July 25, 2018 11:49 pm
(@iskandar)
Member
Joined: 6 years ago

Hi everyone, I don't really understand about passing variable  from sub report. So i wanna try it and i edit reports from Julian, adding a variable in to Sub report but the result is always zero. I mean i make string variable and the value is "For Test" but why the result is zero, Can anyone help?.

 

Thank You

gl61ax10ForTest.rpx

ap654501ForTest.rpx


Reply
Tim Rodman
Posts: 3204
 Tim Rodman
Admin
August 3, 2018 6:29 am
(@timrodman)
Famed Member
Joined: 10 years ago

Hi @iskandar,

I believe the variable in the Subreport only gets set if there are records. In your screenshot, the Transfers subreport section is empty for every GL Account. Can you find a page that actually has some records in the Transfers section? Then we'll know for sure whether the variable is actually getting set in the Subreport.


Reply
Tim Rodman
Posts: 3204
 Tim Rodman
Admin
February 7, 2019 10:49 pm
(@timrodman)
Famed Member
Joined: 10 years ago

Are you sure that any records are printing in the Subreport? It doesn't look like it from the last screenshot. Since you put the variable in the detailSection1 of the Subreport, it will only calculate if the Subreport pulls data. It doesn't look like any data rows from the Subreport are printing in your screenshot.

I just posted an example of calling a Subreport variable from a Main report here:
https://www.augforums.com/augforums/acumatica-report-designer/reset-group-on-a-sub-report/#post-3548


Reply
jentran
Posts: 6
 jentran
January 3, 2020 8:08 pm
(@jentran)
Active Member
Joined: 6 years ago

Hi guys,
I'm having an issue with passing a subreport variable to the main report as well. Hoping someone can spot out what I'm doing wrong. I have 2 subreports in the standard sales order report footer. One for total payment to account for multiple payments scenario. And the other one to break out discounts from regular discounts and a specific negative discount for credit card processing fee. The $PMT_TOTALPMT is working just fine but I don't know why the $DISC_CCFEE doesn't work. Both subreports print ok as subreports but $DISC_CCFEE won't work in a subreport variable. It keeps producing zero value. I have tweaked it so many different ways but still can't get to work for CCFEE.

 

SO641010.rpx

sodisc.rpx


Reply
MichaelHansen
Posts: 149
 MichaelHansen
January 3, 2020 9:05 pm
(@michaelhansen)
Estimable Member
Joined: 6 years ago

The Master report has both Subs set to FALSE for visible. That should be set to TRUE, although you do have it visible for Excel, so it'd show if you export to Excel, but not in the web-browser.

But you said you're seeing a 0... Would you mind posting your other sub-report? It's been a bit since I've hit sub-report variables and they're a bit finnicky, it'd be nice to compare your files. Other than the FALSE visibility flag, this looks reasonable to me, assuming you are indeed checking a file with the discount code CCFEE. 

Wish I had more help to give you... Once you post your second sub, I'll review this again unless Tim/Shawn beat me to it.

 


Reply
Page 1 / 2 Next
Forum Jump:
  Previous Topic
Next Topic  
Forum Information
Recent Posts
Unread Posts
Tags
  • 12 Forums
  • 2,530 Topics
  • 11 K Posts
  • 23 Online
  • 2,418 Members
Our newest member: Chad Treadwell
Latest Post: Negative/Credit Inventory Value?
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

  • Johnny Tang
Acumatica Forums

Terms of Use & Disclaimers :: Privacy Policy

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

‹›×

    ‹›×