Solved

Crystal Reports - Subreport array

Posted on 2014-12-11
5
166 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

What Should I Do With This Threat Intelligence?

Are you wondering if you actually need threat intelligence? The answer is yes. We explain the basics for creating useful threat intelligence.

Join & Write a Comment

Hot fix for .Net Crystal Reports 10.2.3600.0 to fix problems with sub reports running on 64 bit operating systems ISSUE: Reports which contain subreports fail with error "Missing Parameter Value" DEPLOYMENT SERVER OS: Windows 2008 with 64 bi…
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 …
This video demonstrates how to create an example email signature rule for a department in a company using CodeTwo Exchange Rules. The signature will be inserted beneath users' latest emails in conversations and will be displayed in users' Sent Items…
You have products, that come in variants and want to set different prices for them? Watch this micro tutorial that describes how to configure prices for Magento super attributes. Assigning simple products to configurable: We assigned simple products…

705 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

Need Help in Real-Time?

Connect with top rated Experts

18 Experts available now in Live!

Get 1:1 Help Now