All -
i'm trying to do a report with multiple rollups (totals) and a grand total at the end. I have the base report working, but there's some added functionality that I'd like to include that is giving me trouble.
I have included checkboxes on the Request form to allow the user to only view certain rollups of the report. The idea is that a user might want to only view the grand total, and not all of the supporting data.
My checkboxes have a "SourceExpr" equal to global boolean variables, so that when they check the box, the boolean is set to true.
In my OnPreSection() trigger, I have used the following CAL Statement to attempt to dynamically show/hide the section based on the user selection:
CurrReport.SHOWOUTPUT(NOT gMyBooleanVar);
It
ALMOSTworks. When the report renders, it does not show the section in question. Instead, it leaves page after page blank, and displays the grand total on the last page.
Can someone tell me how to prevent the unrendered sections from taking up space on the page so that the grand total shows up on the first page if the user wants to hide all other detail? I tried setting section height dynamically, but I haven't found a way to do it yet.
Answers
Personally I always try to keep booleans to positives. I would rather have a user choice that says "Show Detail", than one that says "Hide Detail". In the first case the code would say SHOWOUTPUT(ShowDetail), in the second it would say SHOWOUTPUT(Not HideDetail). I personally think the second is easy to misinterpret ("when the user checks the box, the value is TRUE, but he means he does NOT want to see detail, so SHOWOUTPUT must be FALSE, but because the variable is TRUE for NOT showing the output, I have to program NOT FALSE for TRUE"), very confusing....
This type of issue is difficult to troubleshoot without access to the actual object though.
RIS Plus, LLC
Normally, I do too. My rule, though, is to have the boolean map to the default condition. The default condition in this case is to show the output. Since checkboxes bound to booleans automatically set the boolean to "True", and I have no way to override that functionality, I'm not sure how else to handle this and retain usability (Believe me, I come from C++ originally, and those guys are nuts about it).
I'll look to see if there's anything out of the ordinary. I thought I had already been through every section, but maybe I missed one.
MVP - Dynamics NAV
My BLOG
NAVERTICA a.s.
I'm still stuck with the same problem. Any other tricks to try? Is there a way to dynamically set the section height on-the-fly?
printoneverypage set to yes?
or placeinbottom?
Can you paste a text file of the report?
http://www.BiloBeauty.com
http://www.autismspeaks.org
it is based on tables that are specific to a custom 3rd-party solution that we're using, so it may not make a lot of sense at first.
:-k
might wanna check the PrintOnEveryPage property too on these sections that won't go away
http://www.BiloBeauty.com
http://www.autismspeaks.org
In a report the first trigger that fires (before the request form is displayed) is OnInitReport, which is where I always program these types of preconditions. So I would have a boolean variable called ShowDetail, with a checkbox on the Options tab, which you can set to the default value of TRUE in the OnInitReport trigger of the report.
RIS Plus, LLC
i think you misunderstood my intent. I'm not stating that the default value of a boolean is TRUE, I'm stating that default behavior of a checkbox bound to a boolean is to set the boolean value to TRUE when the box is checked, and I don't know of any way to override this behavior.
I could just as easily code it this way -
... and maybe I should, because it's more self-documenting in terms of intent, but the statements are equivalent in function right now.
See - in my report, the default behavior is to Show all detail. It is only desirable to not show detail if the user only wants a grand total. Therefore, my checkboxes are labled as "Hide Item Detail", "Hide Lot Detail", etc... When the user checks the box, they indicate that they want to hide that level of detail.
If I reversed the logic (DeMorgan's rule), I would say "Show Item Detail", but this would require action to enable the default behavior - not a desirable situation.
This is why I'm using a NOT operator to check the value of the boolean. I normally do not do this, but the default behavior, in this situation, is negative. For the report to make sense to the user, I have presented them with a positive decision, but I am checking the negated value in code for the proper transformation.
Interesting results.
I did have the primary data item's Header section set to print on every page. Turning it off results in a Two-page output now. One page with the header and no data, and the second page with only the grand total line.
The question now is, what is causing the first page to fill in with blanks, and then I'm golden...
I'm not saying you are wrong, I am just making a case for the way that I would personally do it. Your report has a whole bunch of unchecked checkboxes when the user opens it called "hide x" and "hide y", My version would have a whole bunch of checked checkboxes called "show x" and "show y". They would do exactly the same, but the code in my version would be easier to read (in my personal humble opinion of course
Didn't expect to get a whole dissertation, but thanks for explaining your way of thinking.
RIS Plus, LLC
RIS Plus, LLC
I had NewPagePerRecord and NewPagePerGroup set to True. When I set them to FALSE, it started performing as expected.
http://www.BiloBeauty.com
http://www.autismspeaks.org
Oh, wait. Doesn't Microsoft own Navision
RIS Plus, LLC