Solved

Crystal Reports - Subreport array

Posted on 2014-12-11
5
178 Views
Last Modified: 2014-12-22
I have a Subreport that pulls accounts canceled grouped monthly by Status Date.  It has two arrays - one for the number of accounts canceled and one for the amount canceled.  Here are the formulas:

shared NumberVar Array mthAmtCan;
shared NumberVar Array mthNumCan;

numberVar monthCount:=DateDiff("m",{?Start Date},{Status Date})+1;
mthAmtCan[monthCount]:= Sum ({Balance}, {Status Date}, "monthly");
mthNumCan[monthCount]:= DistinctCount ({Account ID}, {Status Date}, "monthly");
..................................................................................
In my Main Report (grouped monthly by Tran Effective Date) I declare the shared arrays:

shared NumberVar Array mthAmtCan;
shared NumberVar Array mthNumCan;
numberVar ArrayDeclare:=DateDiff("m",{?Start Date},{?End Date})+1;
Redim mthAmtCan[ArrayDeclare];
Redim mthNumCan[ArrayDeclare];

"";
...........................................................
Then display the monthly value on the Group Footer of the Tran Effective Date :

shared NumberVar Array mthNumCan;
numberVar monthCount:=DateDiff("m",{?Start Date},{Tran Effective Date})+1;
mthNumCan[monthCount]



It displays fine unless I have more than 2 years of data, then anything more than 2 years displays as zeros.  I can't be past the 1000 limit on the array data because I'm grouping by month.  Any idea on why it can't display more than 2 years of data?  My Subreport is linked to my main report by the parameters {?Start Date} and {?End Date} and both parameters are used as the criteria for both reports.
0
Comment
Question by:altosax
  • 3
5 Comments
 
LVL 100

Expert Comment

by:mlmcc
ID: 40495374
WHat error do you get?

WHere do the 0's start?
Early months or last months?

Can you upload the report file?

mlmcc
0
 
LVL 100

Accepted Solution

by:
mlmcc earned 500 total points
ID: 40495386
I assume the main report declaration is in the report header.

mlmcc
0
 
LVL 100

Expert Comment

by:mlmcc
ID: 40495388
If you are grouping by month and displaying in the group footer, why the need for the array?

mlmcc
0
 
LVL 34

Expert Comment

by:James0628
ID: 40495884
It would be best if you could u/l the report file, so that we could see everything for ourselves.  In the mean time:

 Can you post your actual formulas?  {Status Date}, for example, isn't valid in CR, so I know that those aren't your real formulas.  We have no way of knowing what might have been "lost in translation".

 Exactly where are all of the items that you mentioned (the subreport and the formulas)?

 Where is the subreport located in the main report?

 I'm guessing that the first formula is in the subreport.  Where in the subreport?

 Where are the other two formulas located?

 In the first formula, you use {Status Date} to set the array index.  In the last formula, you use {Tran Effective Date}.  Without knowing anything about your data, I can only ask if that really makes sense.  Are those two fields related in some way?

 James
0
 

Author Closing Comment

by:altosax
ID: 40513366
I had the main report declaration in the Page Header.  When I moved it to the Report Header, it now gives me data for all of the years.
0

Featured Post

Optimizing Cloud Backup for Low Bandwidth

With cloud storage prices going down a growing number of SMBs start to use it for backup storage. Unfortunately, business data volume rarely fits the average Internet speed. This article provides an overview of main Internet speed challenges and reveals backup best practices.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Crystal Reports: 5 Tests for Top Performance It is complete, your masterpiece report.  Not only does it meet your customer’s expectations, it blows them out the water, all they want is beautifully summarised and displayed in a myriad of ways. …
I hate sub reports and always consider them the last resort in any reporting solution.  The negative effect on performance and maintainability is just not worth the easy ride they give the report writer.  Nine times out of ten reporting requirements…

831 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question