CoffeeManOhYesIAm
Technical User
Good day all, here's a weird little problem that I've just run across:
I've got a subreport (in Main Report, Details B) that has a formula in its details section. It's the formula's job to determine if SPC charts need to be printed in the main report's Details H section. If they do, a shared variable for suppressing Details H is set to False, and a message appears that identifies the SPC chart requirement. If they are not required, the shared variable is set to True, and another related message is printed.
The formula is:
Notice that I've added a debug message to the formula that reports the value of the shared variable DHsuppress. When the main report is previewed for a record that requires SPC charts, the subreport displays:
Further down in the main report, Details H contains a subreport displaying the SPC chart. That's not the issue of this post, but it is important to note that the Format Section, Suppress X-2 formula for Details H states:
So hopefully by now you can guess where this is going. It just so happens that when the main report is previewed for a record requiring SPC charts, the Details B subreport outputs:
But strangely, the Details H section is getting supressed!
I added another debug formula to the Details C section to determine the value of shared variable DHsuppress which goes like this:
And when the main report is previewed (for the same test record) this formula displays:
So what gives??
How is the value of the shared DHsuppress variable magically changing from False to True?
I'd be grateful for any explanations.
Thanks,
CMoyia
---Technical Information:
Crystal 8.5
Progress DB
ODBC connectivity
-------------------------
I've got a subreport (in Main Report, Details B) that has a formula in its details section. It's the formula's job to determine if SPC charts need to be printed in the main report's Details H section. If they do, a shared variable for suppressing Details H is set to False, and a message appears that identifies the SPC chart requirement. If they are not required, the shared variable is set to True, and another related message is printed.
The formula is:
Code:
[green]// @Analysis Code[/green]
[blue]shared booleanVar[/blue] DHsuppress;
[blue]shared numberVar[/blue] x;
[blue]if[/blue] {JobOper.OprSeq} = x [blue]AND trimleft[/blue]([blue]trim[/blue]({JobOper.AnalysisCode})) = "SPC"
[blue]then[/blue]
(
DHsuppress := [blue]False[/blue]; [green]// show spc chart[/green]
"*** SPC Charts are required at this operation. ***" + [blue]chr[/blue](13) +
"Value of DHsuppress is: " + [blue]ToText[/blue](DHsuppress); )
[blue]else[/blue]
(
DHsuppress := [blue]True[/blue]; [green]// suppress spc chart[/green]
"For more frequent measurements, attach an SPC chart.";)
*** SPC Charts are required at this operation. ***
Value of DHsuppress is: False
Value of DHsuppress is: False
Further down in the main report, Details H contains a subreport displaying the SPC chart. That's not the issue of this post, but it is important to note that the Format Section, Suppress X-2 formula for Details H states:
Code:
[green]// Details H. Suppress X-2[/green]
[blue]Shared booleanVar[/blue] DHsuppress;
[blue]if[/blue] (DHsuppress = [blue]True[/blue])
[blue]then
True
else
False[/blue]
*** SPC Charts are required at this operation. ***
Value of DHsuppress is: False
Value of DHsuppress is: False
But strangely, the Details H section is getting supressed!
I added another debug formula to the Details C section to determine the value of shared variable DHsuppress which goes like this:
Code:
[green]// @Value of DHsuppress.[/green]
[blue]shared booleanVar[/blue] DHsuppress;
"Value of DHsuppress is: " + [blue]ToText[/blue](DHsuppress);
Value of DHsuppress is: True
So what gives??
How is the value of the shared DHsuppress variable magically changing from False to True?
I'd be grateful for any explanations.
Thanks,
CMoyia
---Technical Information:
Crystal 8.5
Progress DB
ODBC connectivity
-------------------------