Solved

Crystal Reports - Subreport array

Posted on 2014-12-11
5
186 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
[X]
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
  • Learn & ask questions
  • 3
5 Comments
 
LVL 101

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 101

Accepted Solution

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

mlmcc
0
 
LVL 101

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 35

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

[Webinar] Learn How Hackers Steal Your Credentials

Do You Know How Hackers Steal Your Credentials? Join us and Skyport Systems to learn how hackers steal your credentials and why Active Directory must be secure to stop them. Thursday, July 13, 2017 10:00 A.M. PDT

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. …
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…
Come and listen to Percona CEO Peter Zaitsev discuss what’s new in Percona open source software, including Percona Server for MySQL (https://www.percona.com/software/mysql-database/percona-server) and MongoDB (https://www.percona.com/software/mongo-…
If you're a developer or IT admin, you’re probably tasked with managing multiple websites, servers, applications, and levels of security on a daily basis. While this can be extremely time consuming, it can also be frustrating when systems aren't wor…

724 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