## Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people, just like you, are talking about what matters.

• Help others & share knowledge
• Earn cash & points
Solved

# Crystal Reports - Subreport array

Posted on 2014-12-11
181 Views
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
Question by:altosax
• 3

LVL 100

Expert Comment

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

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

mlmcc
0

LVL 100

Expert Comment

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

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

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

Question has a verified solution.

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

### Suggested Solutions

There have always been a lot of questions related to when Crystal Reports evaluates report components (such as formulas, summaries, cross-tabs, charts, to name a few examples). Crystal Reports uses a two-pass reporting process to provide greater …
Hello everyone, Hope you find this as helpful as we did. We have on the company I work for an application built in Delphi V with Crystal Reports 8. We all know that Crystal & Delphi can be temperamental sometimes and the worst thing is, nearly…
This video shows how to quickly and easily add an email signature for all users on Exchange 2016. The resulting signature is applied on a server level by Exchange Online. The email signature template has been downloaded from: www.mail-signatures…
Although Jacob Bernoulli (1654-1705) has been credited as the creator of "Binomial Distribution Table", Gottfried Leibniz (1646-1716) did his dissertation on the subject in 1666; Leibniz you may recall is the co-inventor of "Calculus" and beat Isaac…