on 04-09-2012 8:51 PM
Hi,
The structure of my main report depends on whether or not a subreport is suppressed. If it is suppressed, I need a field on my main report in a different place.
The solution I've adopted is to pass a boolean variable from my subreport back to the main report. The formula in my subreport looks something like this:
Shared BooleanVar isResults;
If Count ({MyData.FieldName}) > 0 Then
isResults = True
Else
isResults = False
The subreport is structurally very simple. Report Header, Details, Report Footer. The Details contain the records that populate this subreport if there are any. I've placed the Count summary in the Report Footer. The formula above is also in the formula.
For some reason, this formula is not working correctly. It invariably returns False. If I have two records, and my Count field shows a value of 2, why would my formula return False?
Thank you
Hi Peter,
Does the formula show 'False' in the Main Report or Subeport?
Here's an alternative:
Modify the formula to check if a field is null instead:
Shared BooleanVar isResults;
If isnull({MyData.FieldName}) Then
isResults = False
Else
isResults = True
Place this formula on the Report Header.
-Abhilash
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I believe I've discovered my problem.
The formula is assigning values to the variable with "=". I changed it to ":=" and the shared variable is evaluating to the correct boolean value now.
Thank you for your help.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Unfortunately, none of these solutions seem to be working. Does anyone know of a simpler way to accomplish my goal? Basically, I want to show/suppress a couple of fields on my main report based on whether or not a subreport is blank. Is there a more obvious solution that I'm passing over?
Thanks.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
The count summary must PRINT in your subreport, it can be white text, but it must print in order to pass the value to the main report.
Then the shared formula in the main report must be in the main report after the subreport in order for it to get the value from the subreport.
Debi
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi
Please check in which section of your main report contains this formual and also where your sub report placed in your main report. If you place this formula any of the section which is below of this formula it will not work, because it will not get processed.
Hope this helps.
Thanks,
Sastry
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
90 | |
10 | |
10 | |
10 | |
7 | |
7 | |
6 | |
5 | |
4 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.