Technical Questions
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Technical Questions
Message Icon Topic: Data not being store in variables for subreport Post Reply Post New Topic
Author Message
nbuckalew
Newbie
Newbie


Joined: 08 Apr 2015
Location: United States
Online Status: Offline
Posts: 1
Quote nbuckalew Replybullet Topic: Data not being store in variables for subreport
     Posted: 09 Apr 2015 at 5:56am
Hello,

I currently have a report that is as follows:

Page Header
Group Header #1
-Group Header #2
-Details
-Group Footer #2
<SubReport>
Group Footer #1
Page Footer

I need to pull data from the details section to pass to the SubReport. I created a Formula in the page header with the following code:

Shared stringVar array varHrsUnits := [""];
Shared stringVar array varPayrate := [""];
Shared stringVar array varDeductions := [""];
Shared numberVar xCounter := 1;


I then created a formula in the details section with the following code:

Shared numberVar xCounter;
Shared stringVar array varHrsUnits;
Shared stringVar array varPayrate;
Shared stringVar array varDeductions;

Redim preserve varHrsUnits[UBound(varHrsUnits)+1];
Redim preserve varPayRate[UBound(varPayRate)+1];
Redim preserve varDeductions[UBound(varDeductions)+1];

varHrsUnits[xCounter] := ToText({@Hours});
varPayRate[xCounter] := ToText({@PayRate});
varDeductions[xCounter] := {@DedPayrollCodeDescription};

xCounter := xCounter+1;


However, when I try to access the shared variable data from the subreport, there is only the first record available. I have tried adding the WhilePrintingRecords statement, but to no avail.

Any ideas on why the data is not making it to the subreport?

Thanks in advance!
IP IP Logged
Printable version Printable version

Forum Jump
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot delete your posts in this forum
You cannot edit your posts in this forum
You cannot create polls in this forum
You cannot vote in polls in this forum