Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Inability to pass array from main report to subreport

Status
Not open for further replies.

Xprogrammer

Programmer
Oct 12, 2002
14
US
I am attempting to pass an array from a report to a subreport defined in the main report's footer. The array is initialized in the main report's header in a formula field as:

whileprintingrecords;
shared stringvar array MyArray:= ["", "", "","","",""]
numbervar counter1:=1;

Its values are populated in the detail section in a formula field as

whileprintingrecords;
shared stringvar array MyArray;
numbervar counter1;

MyArray[counter1]:= ({REPORT.DesiredFieldName})


In the subreport, i have a @DisplayArrayContents formula field in the detail section with

whileprintingrecords;
shared stringvar array PlaintiffNameArray;
numbervar subcounter;
PlaintiffNameArray[subcounter];

I also have a suppressed @subcounter formula field in the detail section with contents as
whileprintingrecords;
numbervar subcounter;
subcounter:=subcounter + 1

There is also a suppressed database field in the detail section to ensure output.

My challenge is there is no output from the @DisplayArrayContents field even if i have a fixed subscript.
What gives? Any insight/help greatly appreciated.
 
Addition/Correction

I am using CR 8.

@DisplayArrayContents formula should be whileprintingrecords;
shared stringvar array MyArray;
numbervar subcounter;
MyArray[subcounter];
 
xprogrammer: You need to ensure that the variable name used in your subreport matches that used in the main report in order for the values to be 'shared'. I notice that you are using MyArray in the main report and PlaintiffArray in the sub similarly you have counter in the main and subcounter in the sub - try changing the main to PlaintiffArray and subcounter and see what happens

p.s. your formula also doesn't seem to increment the counter so you would only get 1 element in your array David C. Monks
david.monks@chase-international.com
Accredited Seagate Enterprise Partner
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top