sixtoesofdean
Programmer
Hi.
I'm having some problems with shared variables and sub reports:
I have a main report that declares a shared memory variable in a formula (fmlParam). Its job is simply to populate an array with the values of parameters required by the report and it doesn't access any database fields.
This is dropped on the report Header section (which is suppressed)
Below this (in a page header section) is the link to the sub report; The sub report simply displays the array elements set up in the main report - it is infact a common report header used by all reports in the suite.
The problem:
- All the other reports in the suite work perfectly.
- The one I've added errors when attempting to display the sub report on page 2 of main report, saying that "a subscript must be between 1 and the size of the array"
To help a little, here are the formulae:
Main Report
fmlParam:
shared StringVar Array Parameters;
ReDim Parameters[10];
Parameters[1]:= 'Role: All';
Sub report: (there are 10 formulae fmlparameter1..10 - all mapping onto the appropriate array element defined above.
fmlParameter1
Shared StringVar Array Parameters;
Parameters[1]
.... What I don't understand is
(a) Why this set up works in all other reports
(b) Why it works for page 1 of my own report
(c) Why it fails for subsequent pages - like the array is somehow being dropped.
Anyone help?
PS:
I have done a reasonable comparison between my malfunctioning effort and reports that somehow seem to work?
Could it be because I copied the main report formula from another template (using Copy/Paste)
What is going on in Crystal ??
PPS: I'm using CR8.5 with SP1
Cheers
I'm having some problems with shared variables and sub reports:
I have a main report that declares a shared memory variable in a formula (fmlParam). Its job is simply to populate an array with the values of parameters required by the report and it doesn't access any database fields.
This is dropped on the report Header section (which is suppressed)
Below this (in a page header section) is the link to the sub report; The sub report simply displays the array elements set up in the main report - it is infact a common report header used by all reports in the suite.
The problem:
- All the other reports in the suite work perfectly.
- The one I've added errors when attempting to display the sub report on page 2 of main report, saying that "a subscript must be between 1 and the size of the array"
To help a little, here are the formulae:
Main Report
fmlParam:
shared StringVar Array Parameters;
ReDim Parameters[10];
Parameters[1]:= 'Role: All';
Sub report: (there are 10 formulae fmlparameter1..10 - all mapping onto the appropriate array element defined above.
fmlParameter1
Shared StringVar Array Parameters;
Parameters[1]
.... What I don't understand is
(a) Why this set up works in all other reports
(b) Why it works for page 1 of my own report
(c) Why it fails for subsequent pages - like the array is somehow being dropped.
Anyone help?
PS:
I have done a reasonable comparison between my malfunctioning effort and reports that somehow seem to work?
Could it be because I copied the main report formula from another template (using Copy/Paste)
What is going on in Crystal ??
PPS: I'm using CR8.5 with SP1
Cheers